正在显示
2 个修改的文件
包含
79 行增加
和
39 行删除
app/Console/Commands/UpdateMainHtml.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :UpdateRoute.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/11/20 15:07 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands; | ||
| 11 | + | ||
| 12 | +use App\Models\Blog\Blog; | ||
| 13 | +use App\Models\Blog\BlogCategory; | ||
| 14 | +use App\Models\News\News; | ||
| 15 | +use App\Models\News\NewsCategory; | ||
| 16 | +use App\Models\Product\Category; | ||
| 17 | +use App\Models\Product\Keyword; | ||
| 18 | +use App\Models\Product\Product; | ||
| 19 | +use App\Models\Project\Project; | ||
| 20 | +use App\Models\RouteMap\RouteMap; | ||
| 21 | +use App\Services\ProjectServer; | ||
| 22 | +use Illuminate\Console\Command; | ||
| 23 | +use Illuminate\Support\Facades\DB; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * @remark :更新所有项目的路由 | ||
| 27 | + * @name :UpdateRoute | ||
| 28 | + * @author :lyh | ||
| 29 | + * @method :post | ||
| 30 | + * @time :2023/11/20 15:08 | ||
| 31 | + */ | ||
| 32 | +class UpdateMainHtml extends Command | ||
| 33 | +{ | ||
| 34 | + /** | ||
| 35 | + * The name and signature of the console command. | ||
| 36 | + * | ||
| 37 | + * @var string | ||
| 38 | + */ | ||
| 39 | + protected $signature = 'update_main'; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * The console command description. | ||
| 43 | + * | ||
| 44 | + * @var string | ||
| 45 | + */ | ||
| 46 | + protected $description = '洗数据'; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * @remark :统一更新路由 | ||
| 50 | + * @name :handle | ||
| 51 | + * @author :lyh | ||
| 52 | + * @method :post | ||
| 53 | + * @time :2023/11/20 15:13 | ||
| 54 | + */ | ||
| 55 | + public function handle(){ | ||
| 56 | + $projectModel = new Project(); | ||
| 57 | + $list = $projectModel->list(['is_upgrade'=>0]); | ||
| 58 | + foreach ($list as $v){ | ||
| 59 | + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | ||
| 60 | + ProjectServer::useProject($v['id']); | ||
| 61 | + DB::disconnect('custom_mysql'); | ||
| 62 | + } | ||
| 63 | + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * @remark :洗数据 | ||
| 68 | + * @name :getMainHtml | ||
| 69 | + * @author :lyh | ||
| 70 | + * @method :post | ||
| 71 | + * @time :2023/12/27 18:03 | ||
| 72 | + */ | ||
| 73 | + public function editMainHtml(){ | ||
| 74 | + | ||
| 75 | + } | ||
| 76 | +} |
| @@ -80,14 +80,14 @@ class BTemplateLogic extends BaseLogic | @@ -80,14 +80,14 @@ class BTemplateLogic extends BaseLogic | ||
| 80 | $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 | 80 | $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 |
| 81 | }else{ | 81 | }else{ |
| 82 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 | 82 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 |
| 83 | - $type = $this->getHeaderType($this->param['source'], $is_list);//获取头部底部类型 | 83 | + $type = $this->getCustomizedType($this->param['source'], $is_list);//获取头部底部类型 |
| 84 | $commonInfo = $this->getCommonHtml($type,$is_list,0);//获取定制头部 | 84 | $commonInfo = $this->getCommonHtml($type,$is_list,0);//获取定制头部 |
| 85 | $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); | 85 | $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); |
| 86 | return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]); | 86 | return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]); |
| 87 | } | 87 | } |
| 88 | $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; | 88 | $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; |
| 89 | } | 89 | } |
| 90 | - $type = $this->getHeaderType($this->param['source'], $is_list);//获取头部底部类型 | 90 | + $type = $this->getCustomizedType($this->param['source'], $is_list);//获取头部底部类型 |
| 91 | $commonInfo = $this->getCommonHtml($type,$is_list,$template_id);//获取定制头部 | 91 | $commonInfo = $this->getCommonHtml($type,$is_list,$template_id);//获取定制头部 |
| 92 | $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. | 92 | $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. |
| 93 | $commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html']; | 93 | $commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html']; |
| @@ -184,43 +184,7 @@ class BTemplateLogic extends BaseLogic | @@ -184,43 +184,7 @@ class BTemplateLogic extends BaseLogic | ||
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | /** | 186 | /** |
| 187 | - * @remark :独立头部获取头部底部类型 | ||
| 188 | - * @name :getHeaderType | ||
| 189 | - * @author :lyh | ||
| 190 | - * @method :post | ||
| 191 | - * @time :2023/12/27 11:36 | ||
| 192 | - */ | ||
| 193 | - public function getHeaderType($type,$is_list){ | ||
| 194 | - $resultType = BTemplate::SOURCE_HOME; | ||
| 195 | - if($type == BTemplate::SOURCE_PRODUCT){ | ||
| 196 | - if($is_list == BTemplate::IS_LIST){ | ||
| 197 | - $resultType = BTemplate::TYPE_THREE; | ||
| 198 | - }else{ | ||
| 199 | - $resultType = BTemplate::TYPE_TWO; | ||
| 200 | - } | ||
| 201 | - } | ||
| 202 | - if($type == BTemplate::SOURCE_BLOG){ | ||
| 203 | - if($is_list == BTemplate::IS_LIST){ | ||
| 204 | - $resultType = BTemplate::TYPE_FIVE; | ||
| 205 | - }else{ | ||
| 206 | - $resultType = BTemplate::TYPE_FOUR; | ||
| 207 | - } | ||
| 208 | - } | ||
| 209 | - if($type == BTemplate::SOURCE_NEWS){ | ||
| 210 | - if($is_list == BTemplate::IS_LIST){ | ||
| 211 | - $resultType = BTemplate::TYPE_SEVEN; | ||
| 212 | - }else{ | ||
| 213 | - $resultType = BTemplate::TYPE_SIX; | ||
| 214 | - } | ||
| 215 | - } | ||
| 216 | - if($type == BTemplate::SOURCE_KEYWORD){ | ||
| 217 | - $resultType = BTemplate::TYPE_EIGHT; | ||
| 218 | - } | ||
| 219 | - return $this->success($resultType); | ||
| 220 | - } | ||
| 221 | - | ||
| 222 | - /** | ||
| 223 | - * @remark :定制界面根据source获取type类型 | 187 | + * @remark :根据source获取type类型 |
| 224 | * @name :getType | 188 | * @name :getType |
| 225 | * @author :lyh | 189 | * @author :lyh |
| 226 | * @method :post | 190 | * @method :post |
-
请 注册 或 登录 后发表评论