正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
| @@ -60,7 +60,7 @@ class UpdateMainHtml extends Command | @@ -60,7 +60,7 @@ class UpdateMainHtml extends Command | ||
| 60 | foreach ($list as $v){ | 60 | foreach ($list as $v){ |
| 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 62 | ProjectServer::useProject($v['id']); | 62 | ProjectServer::useProject($v['id']); |
| 63 | - $this->editMainHtml(); | 63 | + $this->editMainHtml($v['id']); |
| 64 | DB::disconnect('custom_mysql'); | 64 | DB::disconnect('custom_mysql'); |
| 65 | } | 65 | } |
| 66 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 66 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -73,7 +73,7 @@ class UpdateMainHtml extends Command | @@ -73,7 +73,7 @@ class UpdateMainHtml extends Command | ||
| 73 | * @method :post | 73 | * @method :post |
| 74 | * @time :2023/12/27 18:03 | 74 | * @time :2023/12/27 18:03 |
| 75 | */ | 75 | */ |
| 76 | - public function editMainHtml(){ | 76 | + public function editMainHtml($project_id){ |
| 77 | $templateModel = new BTemplate(); | 77 | $templateModel = new BTemplate(); |
| 78 | $info = $templateModel->read(['source'=>2,'source_id'=>0]); | 78 | $info = $templateModel->read(['source'=>2,'source_id'=>0]); |
| 79 | if($info !== false){ | 79 | if($info !== false){ |
| @@ -85,14 +85,16 @@ class UpdateMainHtml extends Command | @@ -85,14 +85,16 @@ class UpdateMainHtml extends Command | ||
| 85 | 'is_list'=>1, | 85 | 'is_list'=>1, |
| 86 | 'main_html'=>$info['main_html'], | 86 | 'main_html'=>$info['main_html'], |
| 87 | 'main_css'=>$info['main_css'], | 87 | 'main_css'=>$info['main_css'], |
| 88 | - 'section_list_id'=>$info['section_list_id'] | 88 | + 'section_list_id'=>$info['section_list_id'], |
| 89 | + 'project_id'=>$project_id | ||
| 89 | ]; | 90 | ]; |
| 90 | $mainModel->add($data); | 91 | $mainModel->add($data); |
| 91 | }else{ | 92 | }else{ |
| 92 | $data = [ | 93 | $data = [ |
| 93 | 'main_html'=>$info['main_html'], | 94 | 'main_html'=>$info['main_html'], |
| 94 | 'main_css'=>$info['main_css'], | 95 | 'main_css'=>$info['main_css'], |
| 95 | - 'section_list_id'=>$info['section_list_id'] | 96 | + 'section_list_id'=>$info['section_list_id'], |
| 97 | + 'project_id'=>$project_id, | ||
| 96 | ]; | 98 | ]; |
| 97 | $mainModel->edit($data,['id'=>$mainInfo['id']]); | 99 | $mainModel->edit($data,['id'=>$mainInfo['id']]); |
| 98 | } | 100 | } |
-
请 注册 或 登录 后发表评论