正在显示
6 个修改的文件
包含
47 行增加
和
104 行删除
| @@ -24,7 +24,6 @@ use App\Models\Product\Keyword; | @@ -24,7 +24,6 @@ use App\Models\Product\Keyword; | ||
| 24 | use App\Models\Product\Product; | 24 | use App\Models\Product\Product; |
| 25 | use App\Models\Project\DeployOptimize; | 25 | use App\Models\Project\DeployOptimize; |
| 26 | use App\Models\Project\MinorLanguages; | 26 | use App\Models\Project\MinorLanguages; |
| 27 | -use App\Models\Project\PageSetting; | ||
| 28 | use App\Models\Project\Project; | 27 | use App\Models\Project\Project; |
| 29 | use App\Models\Purchaser\PurchaserInfo; | 28 | use App\Models\Purchaser\PurchaserInfo; |
| 30 | use App\Models\RouteMap\RouteMap; | 29 | use App\Models\RouteMap\RouteMap; |
| @@ -53,105 +52,6 @@ class Demo extends Command | @@ -53,105 +52,6 @@ class Demo extends Command | ||
| 53 | protected $description = 'demo'; | 52 | protected $description = 'demo'; |
| 54 | 53 | ||
| 55 | public function handle(){ | 54 | public function handle(){ |
| 56 | - $pageSettingModel = new PageSetting(); | ||
| 57 | - $pageList = $pageSettingModel->list(); | ||
| 58 | - foreach ($pageList as $v){ | ||
| 59 | - ProjectServer::useProject($v['project_id']); | ||
| 60 | - if($v['product_list'] == 1){ | ||
| 61 | - $param = [ | ||
| 62 | - 'name'=>'产品列表', | ||
| 63 | - 'source'=>2, | ||
| 64 | - 'is_list'=>1, | ||
| 65 | - 'is_custom'=>0, | ||
| 66 | - 'header_status'=>1, | ||
| 67 | - 'footer_status'=>1, | ||
| 68 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 69 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 70 | - ]; | ||
| 71 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 72 | - } | ||
| 73 | - if($v['product_details'] == 1){ | ||
| 74 | - $param = [ | ||
| 75 | - 'name'=>'产品详情', | ||
| 76 | - 'source'=>2, | ||
| 77 | - 'is_list'=>0, | ||
| 78 | - 'is_custom'=>0, | ||
| 79 | - 'header_status'=>1, | ||
| 80 | - 'footer_status'=>1, | ||
| 81 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 82 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 83 | - ]; | ||
| 84 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 85 | - } | ||
| 86 | - if($v['page_list'] == 1){ | ||
| 87 | - $param = [ | ||
| 88 | - 'name'=>'单页面', | ||
| 89 | - 'source'=>9, | ||
| 90 | - 'is_list'=>0, | ||
| 91 | - 'is_custom'=>0, | ||
| 92 | - 'header_status'=>1, | ||
| 93 | - 'footer_status'=>1, | ||
| 94 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 95 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 96 | - ]; | ||
| 97 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 98 | - } | ||
| 99 | - if($v['blog_list'] == 1){ | ||
| 100 | - $param = [ | ||
| 101 | - 'name'=>'博客列表', | ||
| 102 | - 'source'=>3, | ||
| 103 | - 'is_list'=>1, | ||
| 104 | - 'is_custom'=>0, | ||
| 105 | - 'header_status'=>1, | ||
| 106 | - 'footer_status'=>1, | ||
| 107 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 108 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 109 | - ]; | ||
| 110 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 111 | - } | ||
| 112 | - if($v['blog_details'] == 1){ | ||
| 113 | - $param = [ | ||
| 114 | - 'name'=>'博客详情', | ||
| 115 | - 'source'=>3, | ||
| 116 | - 'is_list'=>0, | ||
| 117 | - 'is_custom'=>0, | ||
| 118 | - 'header_status'=>1, | ||
| 119 | - 'footer_status'=>1, | ||
| 120 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 121 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 122 | - ]; | ||
| 123 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 124 | - } | ||
| 125 | - if($v['news_list'] == 1){ | ||
| 126 | - $param = [ | ||
| 127 | - 'name'=>'新闻列表', | ||
| 128 | - 'source'=>4, | ||
| 129 | - 'is_list'=>1, | ||
| 130 | - 'is_custom'=>0, | ||
| 131 | - 'header_status'=>1, | ||
| 132 | - 'footer_status'=>1, | ||
| 133 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 134 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 135 | - ]; | ||
| 136 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 137 | - } | ||
| 138 | - if($v['news_details'] == 1){ | ||
| 139 | - $param = [ | ||
| 140 | - 'name'=>'新闻详情', | ||
| 141 | - 'source'=>4, | ||
| 142 | - 'is_list'=>0, | ||
| 143 | - 'is_custom'=>0, | ||
| 144 | - 'header_status'=>1, | ||
| 145 | - 'footer_status'=>1, | ||
| 146 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 147 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 148 | - ]; | ||
| 149 | - DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param); | ||
| 150 | - } | ||
| 151 | - DB::disconnect('custom_mysql'); | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - | ||
| 155 | 55 | ||
| 156 | } | 56 | } |
| 157 | 57 |
| @@ -26,4 +26,21 @@ class BProjectIsComController extends BaseController | @@ -26,4 +26,21 @@ class BProjectIsComController extends BaseController | ||
| 26 | $data = $logic->getIsComConfig(); | 26 | $data = $logic->getIsComConfig(); |
| 27 | $this->response('success',Code::SUCCESS,$data); | 27 | $this->response('success',Code::SUCCESS,$data); |
| 28 | } | 28 | } |
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * @remark :保存配置 | ||
| 32 | + * @name :saveComConfig | ||
| 33 | + * @author :lyh | ||
| 34 | + * @method :post | ||
| 35 | + * @time :2024/8/1 15:38 | ||
| 36 | + */ | ||
| 37 | + public function saveComConfig(BProjectIsComLogic $logic){ | ||
| 38 | + $this->request->validate([ | ||
| 39 | + 'data'=>'required', | ||
| 40 | + ],[ | ||
| 41 | + 'data.required' => 'data不能为空', | ||
| 42 | + ]); | ||
| 43 | + $logic->saveComConfig(); | ||
| 44 | + $this->response('success'); | ||
| 45 | + } | ||
| 29 | } | 46 | } |
| @@ -70,7 +70,7 @@ class BProjectIsComLogic extends BaseLogic | @@ -70,7 +70,7 @@ class BProjectIsComLogic extends BaseLogic | ||
| 70 | $is_list = [self::IS_LIST,self::IS_DETAIL]; | 70 | $is_list = [self::IS_LIST,self::IS_DETAIL]; |
| 71 | foreach ($is_list as $isValue){ | 71 | foreach ($is_list as $isValue){ |
| 72 | //查询当前数据是否已保存 | 72 | //查询当前数据是否已保存 |
| 73 | - $info = $this->read(['source'=>$pValue,'is_list'=>$isValue,'is_custom'=>BTemplate::IS_NO_CUSTOM],['name','source','is_list','is_custom','header_status','footer_status']); | 73 | + $info = $this->model->read(['source'=>$pValue,'is_list'=>$isValue,'is_custom'=>BTemplate::IS_NO_CUSTOM],['name','source','is_list','is_custom','header_status','footer_status']); |
| 74 | if($info !== false){ | 74 | if($info !== false){ |
| 75 | $data[] = $info; | 75 | $data[] = $info; |
| 76 | }else{ | 76 | }else{ |
| @@ -98,7 +98,7 @@ class BProjectIsComLogic extends BaseLogic | @@ -98,7 +98,7 @@ class BProjectIsComLogic extends BaseLogic | ||
| 98 | public function initPageParamData(&$data){ | 98 | public function initPageParamData(&$data){ |
| 99 | $initPageParam = $this->model->initPageParam; | 99 | $initPageParam = $this->model->initPageParam; |
| 100 | foreach($initPageParam as $key => $value){ | 100 | foreach($initPageParam as $key => $value){ |
| 101 | - $info = $this->read(['source'=>$value,'is_list'=>self::IS_DETAIL,'is_custom'=>BTemplate::IS_NO_CUSTOM],['name','source','is_list','is_custom','header_status','footer_status']); | 101 | + $info = $this->model->read(['source'=>$value,'is_list'=>self::IS_DETAIL,'is_custom'=>BTemplate::IS_NO_CUSTOM],['name','source','is_list','is_custom','header_status','footer_status']); |
| 102 | if($info !== false){ | 102 | if($info !== false){ |
| 103 | $data[] = $info; | 103 | $data[] = $info; |
| 104 | }else{ | 104 | }else{ |
| @@ -145,4 +145,26 @@ class BProjectIsComLogic extends BaseLogic | @@ -145,4 +145,26 @@ class BProjectIsComLogic extends BaseLogic | ||
| 145 | } | 145 | } |
| 146 | return $this->success($data); | 146 | return $this->success($data); |
| 147 | } | 147 | } |
| 148 | + | ||
| 149 | + /** | ||
| 150 | + * @remark :保存配置 | ||
| 151 | + * @name :saveComConfig | ||
| 152 | + * @author :lyh | ||
| 153 | + * @method :post | ||
| 154 | + * @time :2024/8/1 15:41 | ||
| 155 | + */ | ||
| 156 | + public function saveComConfig(){ | ||
| 157 | + $data = $this->param['data']; | ||
| 158 | + foreach ($data as $k => $v){ | ||
| 159 | + if(isset($v['id']) && !empty($v['id'])){ | ||
| 160 | + $id = $v['id']; | ||
| 161 | + unset($v['id']); | ||
| 162 | + $this->model->edit($v,['id'=>$id]); | ||
| 163 | + }else{ | ||
| 164 | + //查询当前数据是否存在 | ||
| 165 | + $this->model->add($v); | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + return $this->success(); | ||
| 169 | + } | ||
| 148 | } | 170 | } |
| @@ -188,6 +188,7 @@ class UserLoginLogic | @@ -188,6 +188,7 @@ class UserLoginLogic | ||
| 188 | $info['is_visualization'] = json_decode($project['is_visualization']); | 188 | $info['is_visualization'] = json_decode($project['is_visualization']); |
| 189 | } | 189 | } |
| 190 | $info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority']; | 190 | $info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority']; |
| 191 | + $info['is_inquiry_country'] = $project['is_inquiry_country']; | ||
| 191 | //是否开通AMP | 192 | //是否开通AMP |
| 192 | $is_amp = 0; | 193 | $is_amp = 0; |
| 193 | if(!empty($project['deploy_optimize']['domain'])){ | 194 | if(!empty($project['deploy_optimize']['domain'])){ |
| @@ -293,6 +294,7 @@ class UserLoginLogic | @@ -293,6 +294,7 @@ class UserLoginLogic | ||
| 293 | $info['is_visualization'] = json_decode($project['is_visualization']); | 294 | $info['is_visualization'] = json_decode($project['is_visualization']); |
| 294 | } | 295 | } |
| 295 | $info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority']; | 296 | $info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority']; |
| 297 | + $info['is_inquiry_country'] = $project['is_inquiry_country']; | ||
| 296 | //是否开通AMP | 298 | //是否开通AMP |
| 297 | $is_amp = 0; | 299 | $is_amp = 0; |
| 298 | if(!empty($project['deploy_optimize']['domain'])){ | 300 | if(!empty($project['deploy_optimize']['domain'])){ |
| @@ -30,7 +30,6 @@ class ProjectIsCom extends Base | @@ -30,7 +30,6 @@ class ProjectIsCom extends Base | ||
| 30 | * @var array | 30 | * @var array |
| 31 | */ | 31 | */ |
| 32 | public $initParam = [ | 32 | public $initParam = [ |
| 33 | - '首页'=>BTemplate::SOURCE_HOME, | ||
| 34 | '产品'=>BTemplate::SOURCE_PRODUCT, | 33 | '产品'=>BTemplate::SOURCE_PRODUCT, |
| 35 | '博客'=>BTemplate::SOURCE_BLOG, | 34 | '博客'=>BTemplate::SOURCE_BLOG, |
| 36 | '新闻'=>BTemplate::SOURCE_NEWS, | 35 | '新闻'=>BTemplate::SOURCE_NEWS, |
| @@ -41,6 +40,7 @@ class ProjectIsCom extends Base | @@ -41,6 +40,7 @@ class ProjectIsCom extends Base | ||
| 41 | * @var array | 40 | * @var array |
| 42 | */ | 41 | */ |
| 43 | public $initPageParam = [ | 42 | public $initPageParam = [ |
| 43 | + '首页'=>BTemplate::SOURCE_HOME, | ||
| 44 | '单页面'=>BTemplate::SOURCE_PAGE, | 44 | '单页面'=>BTemplate::SOURCE_PAGE, |
| 45 | ]; | 45 | ]; |
| 46 | 46 |
| @@ -556,7 +556,9 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -556,7 +556,9 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 556 | }); | 556 | }); |
| 557 | //设置公共头部+底部配置 | 557 | //设置公共头部+底部配置 |
| 558 | Route::prefix('com_config')->group(function () { | 558 | Route::prefix('com_config')->group(function () { |
| 559 | - Route::any('/getIsComConfig', [\App\Http\Controllers\Bside\Template\BProjectIsComController::class, 'getIsComConfig'])->name('template_label_getUserLists'); | 559 | + Route::any('/getIsComConfig', [\App\Http\Controllers\Bside\Template\BProjectIsComController::class, 'getIsComConfig'])->name('com_config_getIsComConfig'); |
| 560 | + Route::any('/saveComConfig', [\App\Http\Controllers\Bside\Template\BProjectIsComController::class, 'saveComConfig'])->name('com_config_getIsComConfig'); | ||
| 561 | + | ||
| 560 | }); | 562 | }); |
| 561 | }); | 563 | }); |
| 562 | //无需登录验证的路由组 | 564 | //无需登录验证的路由组 |
-
请 注册 或 登录 后发表评论