作者 lyh

gx

@@ -59,17 +59,40 @@ class UpdateMainHtml extends Command @@ -59,17 +59,40 @@ class UpdateMainHtml extends Command
59 */ 59 */
60 public function handle(){ 60 public function handle(){
61 $projectModel = new Project(); 61 $projectModel = new Project();
62 - $list = $projectModel->list(['id'=>223]); 62 + $list = $projectModel->list(['is_upgrade'=>0,'type'=>['!=',0]]);
63 foreach ($list as $v){ 63 foreach ($list as $v){
64 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 64 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
65 ProjectServer::useProject($v['id']); 65 ProjectServer::useProject($v['id']);
66 - $this->setBlogCustomContent(); 66 + $this->getVideoModule($v['id']);
67 DB::disconnect('custom_mysql'); 67 DB::disconnect('custom_mysql');
68 } 68 }
69 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 69 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
70 } 70 }
71 71
72 /** 72 /**
  73 + * @remark :查看项目是否有video模块
  74 + * @name :getVideoModule
  75 + * @author :lyh
  76 + * @method :post
  77 + * @time :2024/1/29 11:29
  78 + */
  79 + public function getVideoModule($project_id){
  80 + $customModel = new CustomModule();
  81 + $info = $customModel->read(['name'=>'视频模块']);
  82 + if($info === false){
  83 + echo date('Y-m-d H:i:s') . '添加,项目id:'.$project_id . PHP_EOL;
  84 + //执行添加
  85 + $data = [
  86 + 'name'=>'视频模块',
  87 + 'project_id'=>$project_id,
  88 + 'route'=>'video',
  89 + ];
  90 + $customModel->add($data);
  91 + }
  92 + return true;
  93 + }
  94 +
  95 + /**
73 * @remark :所有博客数据添加到自定义模块 96 * @remark :所有博客数据添加到自定义模块
74 * @name :setBlogCustom 97 * @name :setBlogCustom
75 * @author :lyh 98 * @author :lyh