正在显示
1 个修改的文件
包含
24 行增加
和
3 行删除
| @@ -18,6 +18,7 @@ use App\Models\Product\Keyword; | @@ -18,6 +18,7 @@ use App\Models\Product\Keyword; | ||
| 18 | use App\Models\Product\Product; | 18 | use App\Models\Product\Product; |
| 19 | use App\Models\Project\Project; | 19 | use App\Models\Project\Project; |
| 20 | use App\Models\RouteMap\RouteMap; | 20 | use App\Models\RouteMap\RouteMap; |
| 21 | +use App\Models\Template\BTemplate; | ||
| 21 | use App\Models\Template\BTemplateMain; | 22 | use App\Models\Template\BTemplateMain; |
| 22 | use App\Services\ProjectServer; | 23 | use App\Services\ProjectServer; |
| 23 | use Illuminate\Console\Command; | 24 | use Illuminate\Console\Command; |
| @@ -73,9 +74,29 @@ class UpdateMainHtml extends Command | @@ -73,9 +74,29 @@ class UpdateMainHtml extends Command | ||
| 73 | * @time :2023/12/27 18:03 | 74 | * @time :2023/12/27 18:03 |
| 74 | */ | 75 | */ |
| 75 | public function editMainHtml(){ | 76 | public function editMainHtml(){ |
| 76 | - $mainModel = new BTemplateMain(); | ||
| 77 | -// $mainModel->edit(['type'=>3],['type'=>4]); | ||
| 78 | - $mainModel->edit(['type'=>4],['type'=>6]); | 77 | + $templateModel = new BTemplate(); |
| 78 | + $info = $templateModel->read(['source'=>2,'source_id'=>0]); | ||
| 79 | + if($info !== false){ | ||
| 80 | + $mainModel = new BTemplateMain(); | ||
| 81 | + $mainInfo = $mainModel->read(['type'=>2,'is_list'=>1]); | ||
| 82 | + if($mainInfo === false){ | ||
| 83 | + $data = [ | ||
| 84 | + 'type'=>2, | ||
| 85 | + 'is_list'=>1, | ||
| 86 | + 'main_html'=>$info['main_html'], | ||
| 87 | + 'main_css'=>$info['main_css'], | ||
| 88 | + 'section_list_id'=>$info['section_list_id'] | ||
| 89 | + ]; | ||
| 90 | + $mainModel->add($data); | ||
| 91 | + }else{ | ||
| 92 | + $data = [ | ||
| 93 | + 'main_html'=>$info['main_html'], | ||
| 94 | + 'main_css'=>$info['main_css'], | ||
| 95 | + 'section_list_id'=>$info['section_list_id'] | ||
| 96 | + ]; | ||
| 97 | + $mainModel->edit($data,['id'=>$mainInfo['id']]); | ||
| 98 | + } | ||
| 99 | + } | ||
| 79 | return true; | 100 | return true; |
| 80 | } | 101 | } |
| 81 | } | 102 | } |
-
请 注册 或 登录 后发表评论