作者 lyh

gx添加随机模块

@@ -56,13 +56,38 @@ class lyhDemo extends Command @@ -56,13 +56,38 @@ class lyhDemo extends Command
56 protected $description = '更新路由'; 56 protected $description = '更新路由';
57 57
58 public function handle(){ 58 public function handle(){
59 - $string = '<p>Wow, the 137th Canton Fair was quite a game changer for EV Charging Pile suppliers! Seriously, it showcased some amazing growth in international participation and trade opportunities. Can you believe it? They reported a record-breaking 288,938 overseas buyers from 219 countries and regions, which is a 17.3% jump compared to the last fair. This kind of surge really highlights just how much the demand for electric vehicle infrastructure is ramping up. Industry forecasts suggest global EV sales could hit around 26 million units by 2030! And get this, export intentions at the fair climbed to a whopping $25.44 billion, marking a 3% increase. It’s clear that this fair has become a vital hub for manufacturers and suppliers in the EV Charging Pile sector, connecting them with international markets. Plus, the online platform keeps the networking going year-round, so companies can tap into new opportunities even after the fair wraps up. As everyone gears up for the 138th Canton Fair, it’s the perfect time for businesses to strategically carve out their space in the ever-growing EV charging scene.</p><img src="https://ecdn6.globalso.com/public/img/2025-05-24/9834757034_0.png" alt="Unlocking Global Opportunities at the 137th Canton Fair for Ev Charging Pile Suppliers" itemprop="image">';  
60 - $promote = AiCommand::where(['key' => 'ai_layout_design'])->first();  
61 - $promote = str_replace("{html}", $string, $promote->ai);  
62 - $aiCommandService = new AiCommandService();  
63 - $result = $aiCommandService->send_layout_design($promote);  
64 - dd($result);  
65 - return true; 59 + $projectModel = new Project();
  60 + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']);
  61 + foreach ($lists as $item){
  62 + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
  63 + ProjectServer::useProject($item['id']);
  64 + $authorModel = new AiBlogAuthor();
  65 + $author_list = $authorModel->list(['id'=>['>',0]]);
  66 + $projectAiSettingModel = new ProjectAiSetting();
  67 + $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$item['id']]);
  68 + if(empty($aiSettingInfo)){
  69 + echo '跳过的项目id:'.$item['id'].PHP_EOL;
  70 + DB::disconnect('custom_mysql');
  71 + continue;
  72 + }
  73 + $aiBlogService = new AiBlogService($item['id']);
  74 + foreach ($author_list as $val){
  75 + $aiBlogService->author_id = $val['author_id'];
  76 + $result = $aiBlogService->getAuthorDetail();
  77 + if(isset($result['status']) && $result['status'] == 200){
  78 + //当前作者的页面
  79 + $aiBlogAuthorModel = new AiBlogAuthor();
  80 + $authorInfo = $aiBlogAuthorModel->read(['author_id'=>$val['author_id']],['id','route']);
  81 + if($authorInfo !== false && !empty($result['data']['section'])){
  82 + $aiBlogAuthorModel->edit(['text'=>$result['data']['section']],['author_id'=>$val['author_id']]);
  83 + }
  84 + }
  85 + }
  86 + DB::disconnect('custom_mysql');
  87 + }
  88 +
  89 +
  90 + $result = $aiBlogService->getAuthorDetail();
66 } 91 }
67 92
68 public function _actionTemplateMain(){ 93 public function _actionTemplateMain(){