Merge remote-tracking branch 'origin/master' into akun
正在显示
18 个修改的文件
包含
336 行增加
和
73 行删除
| @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command | @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command | ||
| 33 | protected $description = '升级项目统计'; | 33 | protected $description = '升级项目统计'; |
| 34 | 34 | ||
| 35 | public function handle(){ | 35 | public function handle(){ |
| 36 | - $project_id = 555; | 36 | + $project_id = 439; |
| 37 | ProjectServer::useProject($project_id); | 37 | ProjectServer::useProject($project_id); |
| 38 | $this->count($project_id); | 38 | $this->count($project_id); |
| 39 | DB::disconnect('custom_mysql'); | 39 | DB::disconnect('custom_mysql'); |
| @@ -43,8 +43,10 @@ class DomainInfo extends Command | @@ -43,8 +43,10 @@ class DomainInfo extends Command | ||
| 43 | foreach ($list as $v){ | 43 | foreach ($list as $v){ |
| 44 | if(empty($v['private_key']) || empty($v['private_cert'])){ | 44 | if(empty($v['private_key']) || empty($v['private_cert'])){ |
| 45 | //域名结束时间<2天时,重新生成 | 45 | //域名结束时间<2天时,重新生成 |
| 46 | - if(!empty($v['certificate_end_time']) && ($v['certificate_end_time'] > date('Y-m-d H:i:s',time() + 24*3600))){ | ||
| 47 | - $this->updatePrivate($v); | 46 | + if(!empty($v['certificate_end_time'])){ |
| 47 | + if(($v['certificate_end_time'] > date('Y-m-d H:i:s',time() + 24*3600)) || ($v['certificate_end_time'] < date('Y-m-d H:i:s',time()))){ | ||
| 48 | + $this->updatePrivate($v); | ||
| 49 | + } | ||
| 48 | } | 50 | } |
| 49 | } | 51 | } |
| 50 | $ssl = $this->updateDomainSsl($v['domain']); | 52 | $ssl = $this->updateDomainSsl($v['domain']); |
| @@ -77,7 +79,6 @@ class DomainInfo extends Command | @@ -77,7 +79,6 @@ class DomainInfo extends Command | ||
| 77 | public function updatePrivate($param) | 79 | public function updatePrivate($param) |
| 78 | { | 80 | { |
| 79 | $url = 'https://' . $param['domain']. '/api/applySsl/'; | 81 | $url = 'https://' . $param['domain']. '/api/applySsl/'; |
| 80 | - $extend_config = json_decode($param['extend_config'], true); | ||
| 81 | $top_domain = $this->getTopDomain($param['domain']); | 82 | $top_domain = $this->getTopDomain($param['domain']); |
| 82 | if ((empty($extend_config) || empty($extend_config[0]['origin'])) && $param['id'] != 3) { | 83 | if ((empty($extend_config) || empty($extend_config[0]['origin'])) && $param['id'] != 3) { |
| 83 | $extend_config = [ | 84 | $extend_config = [ |
| @@ -89,13 +90,14 @@ class DomainInfo extends Command | @@ -89,13 +90,14 @@ class DomainInfo extends Command | ||
| 89 | 'type' => 1, | 90 | 'type' => 1, |
| 90 | 'route' => 1, | 91 | 'route' => 1, |
| 91 | "domain" =>$param['domain'], | 92 | "domain" =>$param['domain'], |
| 92 | - "rewrite"=> $extend_config, | 93 | + "rewrite"=> $extend_config ?? [], |
| 93 | 'other_domain' => [$top_domain, '*.' . $top_domain], | 94 | 'other_domain' => [$top_domain, '*.' . $top_domain], |
| 94 | 'private_key' => '', | 95 | 'private_key' => '', |
| 95 | 'cert' => '' | 96 | 'cert' => '' |
| 96 | ]; | 97 | ]; |
| 97 | $result = $this->curlRequest($url, $param); | 98 | $result = $this->curlRequest($url, $param); |
| 98 | - Log::info('domain id: ' . $param['id'] . ', domain: ' . $param['domain'] . ', result: ' . var_export($result, true)); | 99 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND); |
| 100 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($param['domain'], true) . PHP_EOL, FILE_APPEND); | ||
| 99 | } | 101 | } |
| 100 | 102 | ||
| 101 | public static function getTopDomain ($url) { | 103 | public static function getTopDomain ($url) { |
| @@ -35,8 +35,8 @@ class UpgradeProjectCount extends Command | @@ -35,8 +35,8 @@ class UpgradeProjectCount extends Command | ||
| 35 | protected $description = '升级项目统计'; | 35 | protected $description = '升级项目统计'; |
| 36 | 36 | ||
| 37 | public function handle(){ | 37 | public function handle(){ |
| 38 | - $project_id = 555; | ||
| 39 | - $url = 'www.sincoherenaesthetics.com'; | 38 | + $project_id = 439; |
| 39 | + $url = 'www.cnzyl.com'; | ||
| 40 | ProjectServer::useProject($project_id); | 40 | ProjectServer::useProject($project_id); |
| 41 | $this->count($project_id,$url); | 41 | $this->count($project_id,$url); |
| 42 | 42 | ||
| @@ -67,6 +67,14 @@ class UpgradeProjectCount extends Command | @@ -67,6 +67,14 @@ class UpgradeProjectCount extends Command | ||
| 67 | $arr['month_total'] = 0; | 67 | $arr['month_total'] = 0; |
| 68 | if(isset($res['data']['count'])){ | 68 | if(isset($res['data']['count'])){ |
| 69 | $arr['month_total'] = $res['data']['count']; | 69 | $arr['month_total'] = $res['data']['count']; |
| 70 | + //获取上一个的count | ||
| 71 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 72 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 73 | + if($previousInfo === false){ | ||
| 74 | + $arr['total'] = $arr['month_total']; | ||
| 75 | + }else{ | ||
| 76 | + $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 77 | + } | ||
| 70 | } | 78 | } |
| 71 | if(isset($res['data']['data'])){ | 79 | if(isset($res['data']['data'])){ |
| 72 | $arr['country'] = json_encode($res['data']['data']); | 80 | $arr['country'] = json_encode($res['data']['data']); |
| @@ -10,11 +10,14 @@ | @@ -10,11 +10,14 @@ | ||
| 10 | namespace App\Console\Commands; | 10 | namespace App\Console\Commands; |
| 11 | 11 | ||
| 12 | use App\Helper\Arr; | 12 | use App\Helper\Arr; |
| 13 | +use App\Models\CustomModule\CustomModuleCategory; | ||
| 14 | +use App\Models\CustomModule\CustomModuleContent; | ||
| 13 | use App\Models\Product\CategoryRelated; | 15 | use App\Models\Product\CategoryRelated; |
| 14 | use App\Models\Product\Keyword; | 16 | use App\Models\Product\Keyword; |
| 15 | use App\Models\Product\Product; | 17 | use App\Models\Product\Product; |
| 16 | use App\Models\Project\Project; | 18 | use App\Models\Project\Project; |
| 17 | use App\Models\RouteMap\RouteMap; | 19 | use App\Models\RouteMap\RouteMap; |
| 20 | +use App\Models\Template\BTemplate; | ||
| 18 | use App\Services\ProjectServer; | 21 | use App\Services\ProjectServer; |
| 19 | use Illuminate\Console\Command; | 22 | use Illuminate\Console\Command; |
| 20 | use Illuminate\Support\Facades\DB; | 23 | use Illuminate\Support\Facades\DB; |
| @@ -51,20 +54,37 @@ class UpdateRoute extends Command | @@ -51,20 +54,37 @@ class UpdateRoute extends Command | ||
| 51 | */ | 54 | */ |
| 52 | public function handle(){ | 55 | public function handle(){ |
| 53 | $projectModel = new Project(); | 56 | $projectModel = new Project(); |
| 54 | - $list = $projectModel->list(['id'=>51]); | 57 | + $list = $projectModel->list(['id'=>99]); |
| 55 | foreach ($list as $v){ | 58 | foreach ($list as $v){ |
| 56 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 59 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 57 | ProjectServer::useProject($v['id']); | 60 | ProjectServer::useProject($v['id']); |
| 58 | // $this->getProduct(); | 61 | // $this->getProduct(); |
| 59 | - $this->setProductKeyword(); | 62 | +// $this->setProductKeyword(); |
| 60 | // $this->getRouteMap(); | 63 | // $this->getRouteMap(); |
| 61 | // $this->getProductCategory(); | 64 | // $this->getProductCategory(); |
| 62 | // $this->delRouteMap(); | 65 | // $this->delRouteMap(); |
| 66 | + $this->setCustomRoute($v['id']); | ||
| 63 | DB::disconnect('custom_mysql'); | 67 | DB::disconnect('custom_mysql'); |
| 64 | } | 68 | } |
| 65 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 69 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 66 | } | 70 | } |
| 67 | 71 | ||
| 72 | + public function setCustomRoute($project_id){ | ||
| 73 | +// $customModel = new CustomModuleContent(); | ||
| 74 | +// $list = $customModel->list(); | ||
| 75 | +// foreach ($list as $v){ | ||
| 76 | +// $route = RouteMap::setRoute($v['name'], RouteMap::SOURCE_MODULE, $v['id'], $project_id); | ||
| 77 | +// $customModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 78 | +// } | ||
| 79 | + $cateModel = new CustomModuleCategory(); | ||
| 80 | + $lists = $cateModel->list(); | ||
| 81 | + foreach ($lists as $v1){ | ||
| 82 | + $route = RouteMap::setRoute($v1['name'], RouteMap::SOURCE_MODULE_CATE, $v1['id'], $project_id); | ||
| 83 | + $cateModel->edit(['route'=>$route],['id'=>$v1['id']]); | ||
| 84 | + | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 68 | /** | 88 | /** |
| 69 | * @remark :写入 | 89 | * @remark :写入 |
| 70 | * @name :getProductKeyword | 90 | * @name :getProductKeyword |
| @@ -34,8 +34,10 @@ class PrivateController extends BaseController | @@ -34,8 +34,10 @@ class PrivateController extends BaseController | ||
| 34 | $result = Project::select($field)->leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id') | 34 | $result = Project::select($field)->leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id') |
| 35 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') | 35 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') |
| 36 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') | 36 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') |
| 37 | - ->where('c.qa_status', '=', OnlineCheck::STATUS_ONLINE_TRUE) | ||
| 38 | ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 37 | ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) |
| 38 | + ->where(function ($subQuery) { | ||
| 39 | + $subQuery->orwhere('c.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); | ||
| 40 | + }) | ||
| 39 | ->paginate($page_size) | 41 | ->paginate($page_size) |
| 40 | ->toArray(); | 42 | ->toArray(); |
| 41 | return $this->success($result); | 43 | return $this->success($result); |
| @@ -65,6 +65,7 @@ class OnlineController extends BaseController | @@ -65,6 +65,7 @@ class OnlineController extends BaseController | ||
| 65 | 'gl_project.channel AS channel', | 65 | 'gl_project.channel AS channel', |
| 66 | 'gl_project.type AS type', | 66 | 'gl_project.type AS type', |
| 67 | 'gl_project.created_at AS created_at', | 67 | 'gl_project.created_at AS created_at', |
| 68 | + 'gl_project.is_upgrade AS is_upgrade', | ||
| 68 | 'gl_project_online_check.id AS online_check_id', | 69 | 'gl_project_online_check.id AS online_check_id', |
| 69 | 'gl_project_online_check.question AS question', | 70 | 'gl_project_online_check.question AS question', |
| 70 | 'gl_project_online_check.optimist_status AS optimist_status', | 71 | 'gl_project_online_check.optimist_status AS optimist_status', |
| @@ -145,6 +146,9 @@ class OnlineController extends BaseController | @@ -145,6 +146,9 @@ class OnlineController extends BaseController | ||
| 145 | if(isset($this->map['all_status'])){ | 146 | if(isset($this->map['all_status'])){ |
| 146 | $query->where('gl_project_online_check.qa_status',$this->map['all_status']); | 147 | $query->where('gl_project_online_check.qa_status',$this->map['all_status']); |
| 147 | } | 148 | } |
| 149 | + if(isset($this->map['is_upgrade'])){ | ||
| 150 | + $query->where('gl_project.is_upgrade',$this->map['is_upgrade']); | ||
| 151 | + } | ||
| 148 | if(isset($this->map['optimist_status'])){ | 152 | if(isset($this->map['optimist_status'])){ |
| 149 | $query->where('gl_project_online_check.optimist_status',$this->map['optimist_status']); | 153 | $query->where('gl_project_online_check.optimist_status',$this->map['optimist_status']); |
| 150 | } | 154 | } |
| @@ -133,6 +133,7 @@ class OptimizeController extends BaseController | @@ -133,6 +133,7 @@ class OptimizeController extends BaseController | ||
| 133 | 'gl_project.robots AS robots', | 133 | 'gl_project.robots AS robots', |
| 134 | 'gl_project.is_translate AS is_translate', | 134 | 'gl_project.is_translate AS is_translate', |
| 135 | 'gl_project.is_translate_tag AS is_translate_tag', | 135 | 'gl_project.is_translate_tag AS is_translate_tag', |
| 136 | + 'gl_project.is_upgrade AS is_upgrade', | ||
| 136 | 'gl_project_online_check.id AS online_check_id', | 137 | 'gl_project_online_check.id AS online_check_id', |
| 137 | 'gl_project_online_check.question AS question', | 138 | 'gl_project_online_check.question AS question', |
| 138 | 'gl_project_online_check.go_question AS go_question', | 139 | 'gl_project_online_check.go_question AS go_question', |
| @@ -191,6 +192,9 @@ class OptimizeController extends BaseController | @@ -191,6 +192,9 @@ class OptimizeController extends BaseController | ||
| 191 | if(isset($this->map['optimize_manager_mid']) && !empty($this->map['optimize_manager_mid'])){ | 192 | if(isset($this->map['optimize_manager_mid']) && !empty($this->map['optimize_manager_mid'])){ |
| 192 | $query = $query->where('gl_project_deploy_optimize.manager_mid','like','%'.$this->map['optimize_manager_mid'].'%'); | 193 | $query = $query->where('gl_project_deploy_optimize.manager_mid','like','%'.$this->map['optimize_manager_mid'].'%'); |
| 193 | } | 194 | } |
| 195 | + if(isset($this->map['is_upgrade']) && !empty($this->map['is_upgrade'])){ | ||
| 196 | + $query = $query->where('gl_project.is_upgrade',$this->map['is_upgrade']); | ||
| 197 | + } | ||
| 194 | if(isset($this->map['optimize_tech_mid']) && !empty($this->map['optimize_tech_mid'])){ | 198 | if(isset($this->map['optimize_tech_mid']) && !empty($this->map['optimize_tech_mid'])){ |
| 195 | $query = $query->where('gl_project_deploy_optimize.tech_mid','like','%'.$this->map['optimize_tech_mid'].'%'); | 199 | $query = $query->where('gl_project_deploy_optimize.tech_mid','like','%'.$this->map['optimize_tech_mid'].'%'); |
| 196 | } | 200 | } |
| @@ -70,7 +70,7 @@ class AyrReleaseController extends BaseController | @@ -70,7 +70,7 @@ class AyrReleaseController extends BaseController | ||
| 70 | //参数处理 | 70 | //参数处理 |
| 71 | $this->param['mediaUrls'] = $ayrReleaseLogic->image_file_param($data); | 71 | $this->param['mediaUrls'] = $ayrReleaseLogic->image_file_param($data); |
| 72 | //时间处理 | 72 | //时间处理 |
| 73 | - $datetime = new \DateTime($this->param['schedule_date']); | 73 | + $datetime = new \DateTime($this->param['schedule_date'] ?? date('Y-m-d H:i:s')); |
| 74 | $formattedTime = $datetime->format("Y-m-d\TH:i:s\Z"); | 74 | $formattedTime = $datetime->format("Y-m-d\TH:i:s\Z"); |
| 75 | //统一生成发布 | 75 | //统一生成发布 |
| 76 | $param = [ | 76 | $param = [ |
| @@ -275,4 +275,16 @@ class BlogController extends BaseController | @@ -275,4 +275,16 @@ class BlogController extends BaseController | ||
| 275 | $logic->setSort(); | 275 | $logic->setSort(); |
| 276 | $this->response('success'); | 276 | $this->response('success'); |
| 277 | } | 277 | } |
| 278 | + | ||
| 279 | + /** | ||
| 280 | + * @remark :批量排序 | ||
| 281 | + * @name :allSort | ||
| 282 | + * @author :lyh | ||
| 283 | + * @method :post | ||
| 284 | + * @time :2024/1/11 9:46 | ||
| 285 | + */ | ||
| 286 | + public function allSort(BlogLogic $logic){ | ||
| 287 | + $logic->setAllSort(); | ||
| 288 | + $this->response('success'); | ||
| 289 | + } | ||
| 278 | } | 290 | } |
| @@ -262,4 +262,16 @@ class NewsController extends BaseController | @@ -262,4 +262,16 @@ class NewsController extends BaseController | ||
| 262 | $newsLogic->setSort(); | 262 | $newsLogic->setSort(); |
| 263 | $this->response('success'); | 263 | $this->response('success'); |
| 264 | } | 264 | } |
| 265 | + | ||
| 266 | + /** | ||
| 267 | + * @remark :批量排序 | ||
| 268 | + * @name :allSort | ||
| 269 | + * @author :lyh | ||
| 270 | + * @method :post | ||
| 271 | + * @time :2024/1/11 9:47 | ||
| 272 | + */ | ||
| 273 | + public function allSort(NewsLogic $newsLogic){ | ||
| 274 | + $newsLogic->setAllSort(); | ||
| 275 | + $this->response('success'); | ||
| 276 | + } | ||
| 265 | } | 277 | } |
| @@ -238,9 +238,13 @@ class ProductController extends BaseController | @@ -238,9 +238,13 @@ class ProductController extends BaseController | ||
| 238 | } | 238 | } |
| 239 | $v['keyword_id_text'] = trim($v['keyword_id_text'],','); | 239 | $v['keyword_id_text'] = trim($v['keyword_id_text'],','); |
| 240 | } | 240 | } |
| 241 | - $v['status_text'] = Product::statusMap()[$v['status']] ?? ''; | 241 | + if(!empty($v['status'])){ |
| 242 | + $v['status_text'] = Product::statusMap()[$v['status']] ?? ''; | ||
| 243 | + }else{ | ||
| 244 | + $v['status_text'] = ''; | ||
| 245 | + } | ||
| 242 | //获取当前用户选择的模版 | 246 | //获取当前用户选择的模版 |
| 243 | - $v['video'] = json_decode($v['video']); | 247 | + $v['video'] = json_decode($v['video'] ?? ''); |
| 244 | $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL); | 248 | $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL); |
| 245 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); | 249 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); |
| 246 | $v['url'] = $this->user['domain'].$v['route']; | 250 | $v['url'] = $this->user['domain'].$v['route']; |
| @@ -421,4 +425,16 @@ class ProductController extends BaseController | @@ -421,4 +425,16 @@ class ProductController extends BaseController | ||
| 421 | $logic->setSort(); | 425 | $logic->setSort(); |
| 422 | $this->response('success'); | 426 | $this->response('success'); |
| 423 | } | 427 | } |
| 428 | + | ||
| 429 | + /** | ||
| 430 | + * @remark :批量更新排序 | ||
| 431 | + * @name :allSort | ||
| 432 | + * @author :lyh | ||
| 433 | + * @method :post | ||
| 434 | + * @time :2024/1/10 15:34 | ||
| 435 | + */ | ||
| 436 | + public function allSort(ProductLogic $logic){ | ||
| 437 | + $logic->setAllSort(); | ||
| 438 | + $this->response('success'); | ||
| 439 | + } | ||
| 424 | } | 440 | } |
| @@ -66,43 +66,118 @@ class BTemplateLogic extends BaseLogic | @@ -66,43 +66,118 @@ class BTemplateLogic extends BaseLogic | ||
| 66 | public function getTemplateHtml(){ | 66 | public function getTemplateHtml(){ |
| 67 | $is_custom = $this->param['is_custom'] ?? 0;//是否为扩展模块 | 67 | $is_custom = $this->param['is_custom'] ?? 0;//是否为扩展模块 |
| 68 | $is_list = $this->param['is_list'] ?? 0;//是否为列表页 | 68 | $is_list = $this->param['is_list'] ?? 0;//是否为列表页 |
| 69 | - $template_id = $this->getSettingTemplate($this->param['source'],$is_list);//设置的模版id | ||
| 70 | - $templateInfo = $this->model->read([ | ||
| 71 | - 'template_id'=>$template_id, 'source'=>$this->param['source'], | ||
| 72 | - 'project_id'=>$this->user['project_id'], 'source_id'=>$this->param['source_id'], | ||
| 73 | - 'is_custom'=>$is_custom, 'is_list'=>$is_list | ||
| 74 | - ]); | 69 | + $template_id = $this->getSettingTemplate($this->param['source'],$is_list,$is_custom);//设置的模版id |
| 70 | + $templateInfo = $this->webTemplateInfo($this->param['source'],$this->param['source_id'],$template_id,$is_custom,$is_list); | ||
| 75 | if($templateInfo === false){ | 71 | if($templateInfo === false){ |
| 76 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//处理定制页面初始数据 | 72 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//处理定制页面初始数据 |
| 77 | - $html = $this->isCustomizedPage($this->param['source'],$is_list);//获取定制页面的html | ||
| 78 | - if(!empty($html)){ | ||
| 79 | - return $this->success(['html'=>$html,'template_id'=>$template_id]); | 73 | + $html = $this->customizedReturnHtml($this->param['source'],$template_id,$is_custom,$is_list); |
| 74 | + if($html !== false){ | ||
| 75 | + return $this->success($html); | ||
| 80 | } | 76 | } |
| 81 | } | 77 | } |
| 78 | + //非定制初始中间部分 | ||
| 82 | $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 | 79 | $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 |
| 83 | }else{ | 80 | }else{ |
| 84 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 | 81 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 |
| 85 | - $type = $this->getCustomizedType($this->param['source'],$is_list); | ||
| 86 | - $commonInfo = $this->getCustomizedCommonHtml($type);//获取定制头部 | ||
| 87 | - $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); | ||
| 88 | - return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]); | 82 | + return $this->getCustomizeAllHtml($templateInfo,$template_id,$is_custom,$is_list); |
| 89 | } | 83 | } |
| 90 | $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; | 84 | $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; |
| 91 | } | 85 | } |
| 92 | - $commonInfo = $this->getCommonHtml($this->param['source'],$is_list,$template_id,$is_custom);//获取定制头部 | ||
| 93 | - $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. | ||
| 94 | - $commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html']; | 86 | + $commonInfo = $this->getCommonHtml($this->param['source'],$is_list,$template_id,$is_custom);//获取非定制头部 |
| 87 | + $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. $commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html']; | ||
| 95 | $html = $this->getHeadFooter($html); | 88 | $html = $this->getHeadFooter($html); |
| 96 | $result = ['html'=>$html,'template_id'=>$template_id]; | 89 | $result = ['html'=>$html,'template_id'=>$template_id]; |
| 97 | - if($templateInfo !== false) | ||
| 98 | - { | ||
| 99 | - $result['id'] = $templateInfo['id']; | ||
| 100 | - $result['updated_at'] = $templateInfo['updated_at']; | ||
| 101 | - } | 90 | + if($templateInfo !== false) {$result['id'] = $templateInfo['id'];$result['updated_at'] = $templateInfo['updated_at'];} |
| 102 | return $this->success($result); | 91 | return $this->success($result); |
| 103 | } | 92 | } |
| 104 | 93 | ||
| 105 | /** | 94 | /** |
| 95 | + * @remark :获取整个html代码 | ||
| 96 | + * @name :getCustomizeAllHtml | ||
| 97 | + * @author :lyh | ||
| 98 | + * @method :post | ||
| 99 | + * @time :2024/1/10 14:15 | ||
| 100 | + */ | ||
| 101 | + public function getCustomizeAllHtml($templateInfo,$template_id,$is_custom,$is_list){ | ||
| 102 | + if($is_custom == BTemplate::IS_CUSTOM){ | ||
| 103 | + $commonInfo = $this->getCustomizedCommonHtml($this->param['source'],$is_custom,$is_list);//获取定制头部 | ||
| 104 | + $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); | ||
| 105 | + }else{ | ||
| 106 | + $type = $this->getCustomizedType($this->param['source'],$is_list); | ||
| 107 | + $commonInfo = $this->getCustomizedCommonHtml($type,$is_custom,$is_list);//获取定制头部 | ||
| 108 | + $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); | ||
| 109 | + } | ||
| 110 | + return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + /** | ||
| 114 | + * @remark :获取装修详情 | ||
| 115 | + * @name :webTemplateInfo | ||
| 116 | + * @author :lyh | ||
| 117 | + * @method :post | ||
| 118 | + * @time :2024/1/10 13:43 | ||
| 119 | + */ | ||
| 120 | + public function webTemplateInfo($source,$source_id,$template_id,$is_custom,$is_list){ | ||
| 121 | + $templateInfo = $this->model->read([ | ||
| 122 | + 'template_id'=>$template_id, 'source'=>$source, | ||
| 123 | + 'project_id'=>$this->user['project_id'], 'source_id'=>$source_id, | ||
| 124 | + 'is_custom'=>$is_custom, 'is_list'=>$is_list | ||
| 125 | + ]); | ||
| 126 | + return $this->success($templateInfo); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + /** | ||
| 130 | + * @remark :定制页面获取html | ||
| 131 | + * @name :customizedReturnHtml | ||
| 132 | + * @author :lyh | ||
| 133 | + * @method :post | ||
| 134 | + * @time :2024/1/10 13:46 | ||
| 135 | + */ | ||
| 136 | + public function customizedReturnHtml($source,$template_id,$is_custom,$is_list){ | ||
| 137 | + //TODO::扩展模块定制单独处理 | ||
| 138 | + if($is_custom == BTemplate::IS_CUSTOM){ | ||
| 139 | + $customModuleModel = new CustomModule(); | ||
| 140 | + $info = $customModuleModel->read(['id'=>$source]); | ||
| 141 | + if($info === false){ | ||
| 142 | + $this->fail('当前扩展模块不存在或已被删除'); | ||
| 143 | + } | ||
| 144 | + //扩展模块定制 | ||
| 145 | + if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION){ | ||
| 146 | + $html = $this->customModuleCustomizeHtml($source,$is_list,$is_custom); | ||
| 147 | + return $this->success(['html'=>$html,'template_id'=>$template_id]); | ||
| 148 | + } | ||
| 149 | + return false; | ||
| 150 | + } | ||
| 151 | + //TODO::默认模块定制 | ||
| 152 | + $html = $this->isCustomizedPage($source,$is_list);//获取定制页面的html | ||
| 153 | + if(!empty($html)){ | ||
| 154 | + return $this->success(['html'=>$html,'template_id'=>$template_id]); | ||
| 155 | + } | ||
| 156 | + return false; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + /** | ||
| 160 | + * @remark :扩展模块定制html | ||
| 161 | + * @name :customModuleInfo | ||
| 162 | + * @author :lyh | ||
| 163 | + * @method :post | ||
| 164 | + * @time :2024/1/10 9:20 | ||
| 165 | + */ | ||
| 166 | + public function customModuleCustomizeHtml($source,$is_list,$is_custom){ | ||
| 167 | + $bTemplateMainModel = new BTemplateMain(); | ||
| 168 | + //TODO::获取初始代码 | ||
| 169 | + $customHtmlInfo = $bTemplateMainModel->read(['type'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom]); | ||
| 170 | + if($customHtmlInfo === false){ | ||
| 171 | + $this->fail('定制页面,请先上传代码块'); | ||
| 172 | + } | ||
| 173 | + $commonInfo = $this->getCustomizedCommonHtml($source,$is_custom,$is_list);//获取定制头部 | ||
| 174 | + if($commonInfo !== false){ | ||
| 175 | + $customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']); | ||
| 176 | + } | ||
| 177 | + return $customHtmlInfo['main_html']; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + /** | ||
| 106 | * @remark :获取中间部分的html | 181 | * @remark :获取中间部分的html |
| 107 | * @name :getMAinHtml | 182 | * @name :getMAinHtml |
| 108 | * @author :lyh | 183 | * @author :lyh |
| @@ -163,7 +238,7 @@ class BTemplateLogic extends BaseLogic | @@ -163,7 +238,7 @@ class BTemplateLogic extends BaseLogic | ||
| 163 | * @method :post | 238 | * @method :post |
| 164 | * @time :2023/12/13 10:55 | 239 | * @time :2023/12/13 10:55 |
| 165 | */ | 240 | */ |
| 166 | - public function isCustomizedPage($source,$is_list) | 241 | + public function isCustomizedPage($source,$is_list,$is_custom) |
| 167 | { | 242 | { |
| 168 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | 243 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 |
| 169 | //查看当前页面是否定制,是否开启可视化 | 244 | //查看当前页面是否定制,是否开启可视化 |
| @@ -171,17 +246,17 @@ class BTemplateLogic extends BaseLogic | @@ -171,17 +246,17 @@ class BTemplateLogic extends BaseLogic | ||
| 171 | if (in_array($type, $page_array)) {//是定制界面 | 246 | if (in_array($type, $page_array)) {//是定制界面 |
| 172 | //TODO::获取初始代码 | 247 | //TODO::获取初始代码 |
| 173 | $bTemplateMainModel = new BTemplateMain(); | 248 | $bTemplateMainModel = new BTemplateMain(); |
| 174 | - $customHtmlInfo = $bTemplateMainModel->read(['type'=>$source,'is_list'=>$is_list]); | 249 | + $customHtmlInfo = $bTemplateMainModel->read(['type'=>$source,'is_custom'=>$is_custom,'is_list'=>$is_list]); |
| 175 | if($customHtmlInfo === false){ | 250 | if($customHtmlInfo === false){ |
| 176 | $this->fail('定制页面,请先上传代码块'); | 251 | $this->fail('定制页面,请先上传代码块'); |
| 177 | } | 252 | } |
| 178 | - $commonInfo = $this->getCustomizedCommonHtml($type);//获取定制头部 | 253 | + $commonInfo = $this->getCustomizedCommonHtml($type,$is_custom,$is_list);//获取定制头部 |
| 179 | if($commonInfo !== false){ | 254 | if($commonInfo !== false){ |
| 180 | $customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']); | 255 | $customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']); |
| 181 | } | 256 | } |
| 182 | return $customHtmlInfo['main_html']; | 257 | return $customHtmlInfo['main_html']; |
| 183 | } | 258 | } |
| 184 | - return []; | 259 | + return false; |
| 185 | } | 260 | } |
| 186 | 261 | ||
| 187 | /** | 262 | /** |
| @@ -191,11 +266,13 @@ class BTemplateLogic extends BaseLogic | @@ -191,11 +266,13 @@ class BTemplateLogic extends BaseLogic | ||
| 191 | * @method :post | 266 | * @method :post |
| 192 | * @time :2023/12/29 13:13 | 267 | * @time :2023/12/29 13:13 |
| 193 | */ | 268 | */ |
| 194 | - public function getCustomizedCommonHtml($type){ | 269 | + public function getCustomizedCommonHtml($type,$is_custom = 0,$is_list = 0){ |
| 195 | $data = [ | 270 | $data = [ |
| 196 | 'template_id' => 0, | 271 | 'template_id' => 0, |
| 197 | 'project_id' => $this->user['project_id'], | 272 | 'project_id' => $this->user['project_id'], |
| 198 | - 'type'=>$type | 273 | + 'type'=>$type, |
| 274 | + 'is_custom'=>$is_custom, | ||
| 275 | + 'is_list'=>$is_list | ||
| 199 | ]; | 276 | ]; |
| 200 | $commonTemplateModel = new BTemplateCommon(); | 277 | $commonTemplateModel = new BTemplateCommon(); |
| 201 | return $commonTemplateModel->read($data); | 278 | return $commonTemplateModel->read($data); |
| @@ -241,14 +318,25 @@ class BTemplateLogic extends BaseLogic | @@ -241,14 +318,25 @@ class BTemplateLogic extends BaseLogic | ||
| 241 | * @method :post | 318 | * @method :post |
| 242 | * @time :2023/12/13 10:48 | 319 | * @time :2023/12/13 10:48 |
| 243 | */ | 320 | */ |
| 244 | - public function getSettingTemplate($source,$is_list){ | 321 | + public function getSettingTemplate($source,$is_list,$is_custom){ |
| 245 | $template_id = 0; | 322 | $template_id = 0; |
| 246 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION) {//定制项目 | 323 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION) {//定制项目 |
| 247 | - $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | ||
| 248 | - //查看当前页面是否定制,是否开启可视化 | ||
| 249 | - $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 | ||
| 250 | - if (in_array($type, $page_array)) {//是定制界面 | ||
| 251 | - return $this->success($template_id); | 324 | + if($is_custom == BTemplate::IS_CUSTOM){ |
| 325 | + $customModuleModel = new CustomModule(); | ||
| 326 | + $info = $customModuleModel->read(['id'=>$source]); | ||
| 327 | + if($info === false){ | ||
| 328 | + $this->fail('当前扩展模块不存在或已被删除'); | ||
| 329 | + } | ||
| 330 | + if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION){ | ||
| 331 | + return $this->success($template_id); | ||
| 332 | + } | ||
| 333 | + }else{ | ||
| 334 | + $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | ||
| 335 | + //查看当前页面是否定制,是否开启可视化 | ||
| 336 | + $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 | ||
| 337 | + if (in_array($type, $page_array)) {//是定制界面 | ||
| 338 | + return $this->success($template_id); | ||
| 339 | + } | ||
| 252 | } | 340 | } |
| 253 | } | 341 | } |
| 254 | $bSettingModel = new Setting(); | 342 | $bSettingModel = new Setting(); |
| @@ -272,7 +360,8 @@ class BTemplateLogic extends BaseLogic | @@ -272,7 +360,8 @@ class BTemplateLogic extends BaseLogic | ||
| 272 | $data = [ | 360 | $data = [ |
| 273 | 'template_id' => $template_id, | 361 | 'template_id' => $template_id, |
| 274 | 'project_id' => $this->user['project_id'], | 362 | 'project_id' => $this->user['project_id'], |
| 275 | - 'type'=>$type | 363 | + 'type'=>$type, |
| 364 | + 'is_custom'=>$is_custom, | ||
| 276 | ]; | 365 | ]; |
| 277 | $commonTemplateModel = new BTemplateCommon(); | 366 | $commonTemplateModel = new BTemplateCommon(); |
| 278 | $commonInfo = $commonTemplateModel->read($data); | 367 | $commonInfo = $commonTemplateModel->read($data); |
| @@ -294,16 +383,10 @@ class BTemplateLogic extends BaseLogic | @@ -294,16 +383,10 @@ class BTemplateLogic extends BaseLogic | ||
| 294 | * @time :2023/6/29 11:05 | 383 | * @time :2023/6/29 11:05 |
| 295 | */ | 384 | */ |
| 296 | public function templateSave(){ | 385 | public function templateSave(){ |
| 297 | - //演示项目不允许修改 | 386 | + //TODO::演示项目不允许修改 |
| 298 | $this->showProjectNoEdit($this->param['source']); | 387 | $this->showProjectNoEdit($this->param['source']); |
| 299 | $this->param = $this->handleDefaultString($this->param);//设置默认数据 | 388 | $this->param = $this->handleDefaultString($this->param);//设置默认数据 |
| 300 | - $templateInfo = $this->model->read([ | ||
| 301 | - 'template_id'=>$this->param['template_id'], | ||
| 302 | - 'source'=>$this->param['source'], | ||
| 303 | - 'source_id'=>$this->param['source_id'], | ||
| 304 | - 'is_custom'=>$this->param['is_custom'], | ||
| 305 | - 'is_list'=>$this->param['is_list'] | ||
| 306 | - ]); | 389 | + $templateInfo = $this->webTemplateInfo($this->param['source'],$this->param['source_id'],$this->param['template_id'],$this->param['is_custom'],$this->param['is_list']); |
| 307 | if($templateInfo === false){//执行新增 | 390 | if($templateInfo === false){//执行新增 |
| 308 | $data = [ | 391 | $data = [ |
| 309 | 'source'=>$this->param['source'], 'source_id'=>$this->param['source_id'],'type'=>BTemplate::PAGE_HTML, | 392 | 'source'=>$this->param['source'], 'source_id'=>$this->param['source_id'],'type'=>BTemplate::PAGE_HTML, |
| @@ -311,7 +394,7 @@ class BTemplateLogic extends BaseLogic | @@ -311,7 +394,7 @@ class BTemplateLogic extends BaseLogic | ||
| 311 | 'section_list_id'=>$this->param['section_list_id'],'is_custom'=>$this->param['is_custom'], | 394 | 'section_list_id'=>$this->param['section_list_id'],'is_custom'=>$this->param['is_custom'], |
| 312 | 'is_list'=>$this->param['is_list'] | 395 | 'is_list'=>$this->param['is_list'] |
| 313 | ]; | 396 | ]; |
| 314 | - $data = $this->handleVisualizationParam($this->param['html'],$this->param['source'],$this->param['is_list'],$data); | 397 | + $data = $this->handleVisualizationParam($this->param['html'],$this->param['source'],$this->param['is_list'],$this->param['is_custom'],$data); |
| 315 | $this->model->add($data); | 398 | $this->model->add($data); |
| 316 | }else{//执行编辑 | 399 | }else{//执行编辑 |
| 317 | $condition = [ | 400 | $condition = [ |
| @@ -322,7 +405,7 @@ class BTemplateLogic extends BaseLogic | @@ -322,7 +405,7 @@ class BTemplateLogic extends BaseLogic | ||
| 322 | $data = [ | 405 | $data = [ |
| 323 | 'section_list_id'=>$this->param['section_list_id'] | 406 | 'section_list_id'=>$this->param['section_list_id'] |
| 324 | ]; | 407 | ]; |
| 325 | - $data = $this->handleVisualizationParam($this->param['html'],$this->param['source'],$this->param['is_list'],$data); | 408 | + $data = $this->handleVisualizationParam($this->param['html'],$this->param['source'],$this->param['is_list'],$this->param['is_custom'],$data); |
| 326 | $this->model->edit($data,$condition); | 409 | $this->model->edit($data,$condition); |
| 327 | } | 410 | } |
| 328 | //更新头部信息 | 411 | //更新头部信息 |
| @@ -355,7 +438,7 @@ class BTemplateLogic extends BaseLogic | @@ -355,7 +438,7 @@ class BTemplateLogic extends BaseLogic | ||
| 355 | * @method :post | 438 | * @method :post |
| 356 | * @time :2023/12/15 10:59 | 439 | * @time :2023/12/15 10:59 |
| 357 | */ | 440 | */ |
| 358 | - public function handleVisualizationParam($html,$source, $is_list,$data){ | 441 | + public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){ |
| 359 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目 | 442 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目 |
| 360 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | 443 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 |
| 361 | //查看当前页面是否定制,是否开启可视化 | 444 | //查看当前页面是否定制,是否开启可视化 |
| @@ -364,6 +447,19 @@ class BTemplateLogic extends BaseLogic | @@ -364,6 +447,19 @@ class BTemplateLogic extends BaseLogic | ||
| 364 | $data['html'] = $html; | 447 | $data['html'] = $html; |
| 365 | $data['type'] = BTemplate::ALL_HTML; | 448 | $data['type'] = BTemplate::ALL_HTML; |
| 366 | }else{ | 449 | }else{ |
| 450 | + //TODO::扩展模块定制单独处理 | ||
| 451 | + if($is_custom == BTemplate::IS_CUSTOM){ | ||
| 452 | + $customModuleModel = new CustomModule(); | ||
| 453 | + $info = $customModuleModel->read(['id'=>$source]); | ||
| 454 | + if($info === false){ | ||
| 455 | + $this->fail('当前扩展模块不存在或已被删除'); | ||
| 456 | + } | ||
| 457 | + //todo::扩展模块(列表页/详情页)定制 | ||
| 458 | + if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) { | ||
| 459 | + $data['html'] = $html; | ||
| 460 | + $data['type'] = BTemplate::ALL_HTML; | ||
| 461 | + } | ||
| 462 | + } | ||
| 367 | $mainInfo = $this->handleTemplateHtml($html); | 463 | $mainInfo = $this->handleTemplateHtml($html); |
| 368 | $data['main_html'] = $mainInfo['main_html']; | 464 | $data['main_html'] = $mainInfo['main_html']; |
| 369 | $data['main_css'] = $mainInfo['main_css']; | 465 | $data['main_css'] = $mainInfo['main_css']; |
| @@ -376,7 +472,6 @@ class BTemplateLogic extends BaseLogic | @@ -376,7 +472,6 @@ class BTemplateLogic extends BaseLogic | ||
| 376 | return $data; | 472 | return $data; |
| 377 | } | 473 | } |
| 378 | 474 | ||
| 379 | - | ||
| 380 | /** | 475 | /** |
| 381 | * @remark :保存公共头部底部 | 476 | * @remark :保存公共头部底部 |
| 382 | * @name :saveCommonHtml | 477 | * @name :saveCommonHtml |
| @@ -385,12 +480,20 @@ class BTemplateLogic extends BaseLogic | @@ -385,12 +480,20 @@ class BTemplateLogic extends BaseLogic | ||
| 385 | * @time :2023/12/13 17:05 | 480 | * @time :2023/12/13 17:05 |
| 386 | */ | 481 | */ |
| 387 | public function saveCommonHtml($html,$source,$is_list,$template_id,$is_custom){ | 482 | public function saveCommonHtml($html,$source,$is_list,$template_id,$is_custom){ |
| 483 | + //TODO::定制扩展模块单独处理 | ||
| 484 | + if($is_custom == BTemplate::IS_CUSTOM){ | ||
| 485 | + $code = $this->saveCustomModuleCommonHtml($html,$source,$is_custom,$is_list,$template_id); | ||
| 486 | + if($code === false){ | ||
| 487 | + return $this->success(); | ||
| 488 | + } | ||
| 489 | + } | ||
| 490 | + //其他情况 | ||
| 388 | $type = $this->getType($source,$is_list,$is_custom);//获取头部类型1-9(首页到自定义页面) | 491 | $type = $this->getType($source,$is_list,$is_custom);//获取头部类型1-9(首页到自定义页面) |
| 389 | if($template_id == 0){//定制页面默认为独立头部 | 492 | if($template_id == 0){//定制页面默认为独立头部 |
| 390 | $type = $this->getCustomizedType($source,$is_list);//定制默认独立头部 | 493 | $type = $this->getCustomizedType($source,$is_list);//定制默认独立头部 |
| 391 | } | 494 | } |
| 392 | $templateCommonModel = new BTemplateCommon(); | 495 | $templateCommonModel = new BTemplateCommon(); |
| 393 | - $commonInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type]);//查看当前头部是否存在 | 496 | + $commonInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type,'is_custom'=>0]);//查看当前头部是否存在 |
| 394 | $handleInfo = $this->handleCommonParam($html); | 497 | $handleInfo = $this->handleCommonParam($html); |
| 395 | if($commonInfo === false){ | 498 | if($commonInfo === false){ |
| 396 | $data = [ | 499 | $data = [ |
| @@ -411,6 +514,45 @@ class BTemplateLogic extends BaseLogic | @@ -411,6 +514,45 @@ class BTemplateLogic extends BaseLogic | ||
| 411 | } | 514 | } |
| 412 | 515 | ||
| 413 | /** | 516 | /** |
| 517 | + * @remark :扩展模块定制保存头部处理 | ||
| 518 | + * @name :saveCustomModuleCommonHtml | ||
| 519 | + * @author :lyh | ||
| 520 | + * @method :post | ||
| 521 | + * @time :2024/1/10 11:33 | ||
| 522 | + */ | ||
| 523 | + public function saveCustomModuleCommonHtml($html,$source,$is_custom,$is_list,$template_id){ | ||
| 524 | + $customModuleModel = new CustomModule(); | ||
| 525 | + $info = $customModuleModel->read(['id'=>$source]); | ||
| 526 | + if($info === false){ | ||
| 527 | + $this->fail('当前扩展模块不存在或已被删除'); | ||
| 528 | + } | ||
| 529 | + //todo::扩展模块(列表页/详情页)定制 | ||
| 530 | + if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) { | ||
| 531 | + $data = ['type'=>$source,'is_custom'=>$is_custom,'is_list'=>$is_list,'template_id'=>$template_id]; | ||
| 532 | + $templateCommonModel = new BTemplateCommon(); | ||
| 533 | + $commonInfo = $templateCommonModel->read($data);//查看当前头部是否存在 | ||
| 534 | + $handleInfo = $this->handleCommonParam($html); | ||
| 535 | + if($commonInfo === false){ | ||
| 536 | + $data = [ | ||
| 537 | + 'head_html'=>$handleInfo['head_html'], 'head_css'=>$handleInfo['head_css'],'other'=>$handleInfo['other'], | ||
| 538 | + 'footer_html'=>$handleInfo['footer_html'], 'footer_css'=>$handleInfo['footer_css'], | ||
| 539 | + 'type'=>$source,'template_id'=>$template_id, 'project_id'=>$this->user['project_id'], | ||
| 540 | + 'is_custom'=>$is_custom,'is_list'=>$is_list, | ||
| 541 | + ]; | ||
| 542 | + $templateCommonModel->add($data); | ||
| 543 | + }else{ | ||
| 544 | + $data = [ | ||
| 545 | + 'head_html'=>$handleInfo['head_html'], 'head_css'=>$handleInfo['head_css'],'other'=>$handleInfo['other'], | ||
| 546 | + 'footer_html'=>$handleInfo['footer_html'], 'footer_css'=>$handleInfo['footer_css'], | ||
| 547 | + ]; | ||
| 548 | + $templateCommonModel->edit($data,['id'=>$commonInfo['id']]); | ||
| 549 | + } | ||
| 550 | + return false; | ||
| 551 | + } | ||
| 552 | + return true; | ||
| 553 | + } | ||
| 554 | + | ||
| 555 | + /** | ||
| 414 | * @remark :演示项目不允许修改首页 | 556 | * @remark :演示项目不允许修改首页 |
| 415 | * @name :showProject | 557 | * @name :showProject |
| 416 | * @author :lyh | 558 | * @author :lyh |
| @@ -457,7 +599,7 @@ class BTemplateLogic extends BaseLogic | @@ -457,7 +599,7 @@ class BTemplateLogic extends BaseLogic | ||
| 457 | return $this->success($param); | 599 | return $this->success($param); |
| 458 | } | 600 | } |
| 459 | /** | 601 | /** |
| 460 | - * @remark :保存时获取获取设置的类型 | 602 | + * @remark :(非定制)保存时获取获取设置的类型 |
| 461 | * @name :getType | 603 | * @name :getType |
| 462 | * @author :lyh | 604 | * @author :lyh |
| 463 | * @method :post | 605 | * @method :post |
| @@ -234,6 +234,20 @@ class BlogLogic extends BaseLogic | @@ -234,6 +234,20 @@ class BlogLogic extends BaseLogic | ||
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | /** | 236 | /** |
| 237 | + * @remark : | ||
| 238 | + * @name :setAllSort | ||
| 239 | + * @author :lyh | ||
| 240 | + * @method :post | ||
| 241 | + * @time :2024/1/10 15:40 | ||
| 242 | + */ | ||
| 243 | + public function setAllSort(){ | ||
| 244 | + foreach ($this->param['data'] as $k => $v){ | ||
| 245 | + $this->model->edit(['sort'=>$v['sort']],['id'=>$v['id']]); | ||
| 246 | + } | ||
| 247 | + return $this->success(); | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + /** | ||
| 237 | * 博客导入 | 251 | * 博客导入 |
| 238 | * @param $project_id | 252 | * @param $project_id |
| 239 | * @param $user_id | 253 | * @param $user_id |
| @@ -250,6 +250,21 @@ class NewsLogic extends BaseLogic | @@ -250,6 +250,21 @@ class NewsLogic extends BaseLogic | ||
| 250 | } | 250 | } |
| 251 | 251 | ||
| 252 | /** | 252 | /** |
| 253 | + * @remark : | ||
| 254 | + * @name :setAllSort | ||
| 255 | + * @author :lyh | ||
| 256 | + * @method :post | ||
| 257 | + * @time :2024/1/10 15:40 | ||
| 258 | + */ | ||
| 259 | + public function setAllSort(){ | ||
| 260 | + foreach ($this->param['data'] as $k => $v){ | ||
| 261 | + $this->model->edit(['sort'=>$v['sort']],['id'=>$v['id']]); | ||
| 262 | + } | ||
| 263 | + return $this->success(); | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + | ||
| 267 | + /** | ||
| 253 | * @remark :删除路由 | 268 | * @remark :删除路由 |
| 254 | * @name :delRoute | 269 | * @name :delRoute |
| 255 | * @author :lyh | 270 | * @author :lyh |
| @@ -599,6 +599,20 @@ class ProductLogic extends BaseLogic | @@ -599,6 +599,20 @@ class ProductLogic extends BaseLogic | ||
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | /** | 601 | /** |
| 602 | + * @remark : | ||
| 603 | + * @name :setAllSort | ||
| 604 | + * @author :lyh | ||
| 605 | + * @method :post | ||
| 606 | + * @time :2024/1/10 15:40 | ||
| 607 | + */ | ||
| 608 | + public function setAllSort(){ | ||
| 609 | + foreach ($this->param['data'] as $k => $v){ | ||
| 610 | + $this->model->edit(['sort'=>$v['sort']],['id'=>$v['id']]); | ||
| 611 | + } | ||
| 612 | + return $this->success(); | ||
| 613 | + } | ||
| 614 | + | ||
| 615 | + /** | ||
| 602 | * 产品导入 | 616 | * 产品导入 |
| 603 | * @param $project_id | 617 | * @param $project_id |
| 604 | * @param $user_id | 618 | * @param $user_id |
| @@ -722,13 +736,11 @@ class ProductLogic extends BaseLogic | @@ -722,13 +736,11 @@ class ProductLogic extends BaseLogic | ||
| 722 | if($data[10]??''){ | 736 | if($data[10]??''){ |
| 723 | $seo_description = substr(strip_tags($data[10]),0,200); | 737 | $seo_description = substr(strip_tags($data[10]),0,200); |
| 724 | } | 738 | } |
| 725 | - | ||
| 726 | $seo_mate = [ | 739 | $seo_mate = [ |
| 727 | 'title' => $seo_title, | 740 | 'title' => $seo_title, |
| 728 | 'keyword' => $seo_keywords, | 741 | 'keyword' => $seo_keywords, |
| 729 | 'description' => $seo_description | 742 | 'description' => $seo_description |
| 730 | ]; | 743 | ]; |
| 731 | - | ||
| 732 | //处理参数 | 744 | //处理参数 |
| 733 | $attrs = []; | 745 | $attrs = []; |
| 734 | if($data[4]??''){ | 746 | if($data[4]??''){ |
| @@ -746,10 +758,8 @@ class ProductLogic extends BaseLogic | @@ -746,10 +758,8 @@ class ProductLogic extends BaseLogic | ||
| 746 | } | 758 | } |
| 747 | } | 759 | } |
| 748 | } | 760 | } |
| 749 | - | ||
| 750 | //处理描述切换栏 | 761 | //处理描述切换栏 |
| 751 | $describe = []; | 762 | $describe = []; |
| 752 | - | ||
| 753 | for ($i=11;$i<=20;$i+=2){ | 763 | for ($i=11;$i<=20;$i+=2){ |
| 754 | if(($data[$i]??'') && ($data[$i+1]??'')){ | 764 | if(($data[$i]??'') && ($data[$i+1]??'')){ |
| 755 | preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[$i+1], $result_desc); | 765 | preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[$i+1], $result_desc); |
| @@ -759,7 +769,6 @@ class ProductLogic extends BaseLogic | @@ -759,7 +769,6 @@ class ProductLogic extends BaseLogic | ||
| 759 | $new_vdesc_img && $data[$i+1] = str_replace($vdesc_img,$new_vdesc_img,$data[$i+1]); | 769 | $new_vdesc_img && $data[$i+1] = str_replace($vdesc_img,$new_vdesc_img,$data[$i+1]); |
| 760 | } | 770 | } |
| 761 | } | 771 | } |
| 762 | - | ||
| 763 | preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[$i+1], $result_desc_video); | 772 | preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[$i+1], $result_desc_video); |
| 764 | if($result_desc_video[2]??[]){ | 773 | if($result_desc_video[2]??[]){ |
| 765 | foreach ($result_desc_video[2] as $vdesc_video){ | 774 | foreach ($result_desc_video[2] as $vdesc_video){ |
| @@ -776,7 +785,6 @@ class ProductLogic extends BaseLogic | @@ -776,7 +785,6 @@ class ProductLogic extends BaseLogic | ||
| 776 | break; | 785 | break; |
| 777 | } | 786 | } |
| 778 | } | 787 | } |
| 779 | - | ||
| 780 | $id = $this->model->addReturnId( | 788 | $id = $this->model->addReturnId( |
| 781 | [ | 789 | [ |
| 782 | 'project_id' => $project_id, | 790 | 'project_id' => $project_id, |
| @@ -794,7 +802,6 @@ class ProductLogic extends BaseLogic | @@ -794,7 +802,6 @@ class ProductLogic extends BaseLogic | ||
| 794 | 'status' => Product::STATUS_ON | 802 | 'status' => Product::STATUS_ON |
| 795 | ] | 803 | ] |
| 796 | ); | 804 | ); |
| 797 | - | ||
| 798 | //更新路由 | 805 | //更新路由 |
| 799 | if($route){ | 806 | if($route){ |
| 800 | $route_map = RouteMap::where('project_id', $project_id)->where('source', RouteMap::SOURCE_PRODUCT)->where('source_id', $id)->first(); | 807 | $route_map = RouteMap::where('project_id', $project_id)->where('source', RouteMap::SOURCE_PRODUCT)->where('source_id', $id)->first(); |
| @@ -810,17 +817,13 @@ class ProductLogic extends BaseLogic | @@ -810,17 +817,13 @@ class ProductLogic extends BaseLogic | ||
| 810 | }else{ | 817 | }else{ |
| 811 | $route = RouteMap::setRoute($data[0], RouteMap::SOURCE_PRODUCT, $id, $project_id); | 818 | $route = RouteMap::setRoute($data[0], RouteMap::SOURCE_PRODUCT, $id, $project_id); |
| 812 | } | 819 | } |
| 813 | - | ||
| 814 | $this->edit(['route' => $route], ['id' => $id]); | 820 | $this->edit(['route' => $route], ['id' => $id]); |
| 815 | - | ||
| 816 | //关联分类 | 821 | //关联分类 |
| 817 | if($category_arr){ | 822 | if($category_arr){ |
| 818 | CategoryRelated::saveRelated($id, $category_arr); | 823 | CategoryRelated::saveRelated($id, $category_arr); |
| 819 | } | 824 | } |
| 820 | - | ||
| 821 | return true; | 825 | return true; |
| 822 | } | 826 | } |
| 823 | - | ||
| 824 | return false; | 827 | return false; |
| 825 | } | 828 | } |
| 826 | } | 829 | } |
| @@ -27,6 +27,7 @@ class AyrReleaseRequest extends FormRequest | @@ -27,6 +27,7 @@ class AyrReleaseRequest extends FormRequest | ||
| 27 | 'content'=>'required', | 27 | 'content'=>'required', |
| 28 | 'share_id'=>'required', | 28 | 'share_id'=>'required', |
| 29 | 'platforms'=>'required|array', | 29 | 'platforms'=>'required|array', |
| 30 | + 'schedule_date'=>'required' | ||
| 30 | ]; | 31 | ]; |
| 31 | } | 32 | } |
| 32 | 33 |
| @@ -30,6 +30,10 @@ class Project extends Base | @@ -30,6 +30,10 @@ class Project extends Base | ||
| 30 | 30 | ||
| 31 | const TYPE_SEVEN = 7;//错误单 | 31 | const TYPE_SEVEN = 7;//错误单 |
| 32 | const MYSQL_ID = 2;//默认数据库id | 32 | const MYSQL_ID = 2;//默认数据库id |
| 33 | + | ||
| 34 | + const IS_UPGRADE_FALSE = 0; | ||
| 35 | + const IS_UPGRADE_TRUE = 1; | ||
| 36 | + | ||
| 33 | /** | 37 | /** |
| 34 | * 星级客户 | 38 | * 星级客户 |
| 35 | * @return string[] | 39 | * @return string[] |
| @@ -81,6 +85,7 @@ class Project extends Base | @@ -81,6 +85,7 @@ class Project extends Base | ||
| 81 | 9 => '星链网站(2年版)', | 85 | 9 => '星链网站(2年版)', |
| 82 | 11 => '俄语标准版', | 86 | 11 => '俄语标准版', |
| 83 | 12 => '俄语商务版', | 87 | 12 => '俄语商务版', |
| 88 | + 13 => '体验版' | ||
| 84 | ]; | 89 | ]; |
| 85 | } | 90 | } |
| 86 | 91 |
| @@ -74,6 +74,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -74,6 +74,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 74 | Route::any('/del', [\App\Http\Controllers\Bside\News\NewsController::class, 'del'])->name('news_del'); | 74 | Route::any('/del', [\App\Http\Controllers\Bside\News\NewsController::class, 'del'])->name('news_del'); |
| 75 | Route::any('/status', [\App\Http\Controllers\Bside\News\NewsController::class, 'status'])->name('news_status'); | 75 | Route::any('/status', [\App\Http\Controllers\Bside\News\NewsController::class, 'status'])->name('news_status'); |
| 76 | Route::any('/sort', [\App\Http\Controllers\Bside\News\NewsController::class, 'sort'])->name('news_sort'); | 76 | Route::any('/sort', [\App\Http\Controllers\Bside\News\NewsController::class, 'sort'])->name('news_sort'); |
| 77 | + Route::any('/allSort', [\App\Http\Controllers\Bside\News\NewsController::class, 'allSort'])->name('news_allSort'); | ||
| 77 | Route::any('/statusNum', [\App\Http\Controllers\Bside\News\NewsController::class, 'getStatusNumber'])->name('news_statusNum'); | 78 | Route::any('/statusNum', [\App\Http\Controllers\Bside\News\NewsController::class, 'getStatusNumber'])->name('news_statusNum'); |
| 78 | }); | 79 | }); |
| 79 | 80 | ||
| @@ -89,6 +90,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -89,6 +90,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 89 | Route::any('/del', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'del'])->name('blog_del'); | 90 | Route::any('/del', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'del'])->name('blog_del'); |
| 90 | Route::any('/status', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'status'])->name('blog_status'); | 91 | Route::any('/status', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'status'])->name('blog_status'); |
| 91 | Route::any('/sort', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'sort'])->name('blog_sort'); | 92 | Route::any('/sort', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'sort'])->name('blog_sort'); |
| 93 | + Route::any('/allSort', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'allSort'])->name('blog_allSort'); | ||
| 92 | Route::any('/statusNum', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'getStatusNumber'])->name('blog_statusNum'); | 94 | Route::any('/statusNum', [\App\Http\Controllers\Bside\Blog\BlogController::class, 'getStatusNumber'])->name('blog_statusNum'); |
| 93 | //分类 | 95 | //分类 |
| 94 | Route::any('/category/', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'lists'])->name('blog_category_lists'); | 96 | Route::any('/category/', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'lists'])->name('blog_category_lists'); |
| @@ -204,6 +206,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -204,6 +206,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 204 | Route::post('/save', [\App\Http\Controllers\Bside\Product\ProductController::class, 'save'])->name('product_save'); | 206 | Route::post('/save', [\App\Http\Controllers\Bside\Product\ProductController::class, 'save'])->name('product_save'); |
| 205 | Route::post('/editList', [\App\Http\Controllers\Bside\Product\ProductController::class, 'editList'])->name('product_editList'); | 207 | Route::post('/editList', [\App\Http\Controllers\Bside\Product\ProductController::class, 'editList'])->name('product_editList'); |
| 206 | Route::post('/sort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'sort'])->name('product_sort'); | 208 | Route::post('/sort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'sort'])->name('product_sort'); |
| 209 | + Route::post('/allSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'allSort'])->name('product_allSort'); | ||
| 207 | Route::any('/delete', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delete'])->name('product_delete'); | 210 | Route::any('/delete', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delete'])->name('product_delete'); |
| 208 | Route::any('/statusNum', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getStatusNumber'])->name('product_statusNum'); | 211 | Route::any('/statusNum', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getStatusNumber'])->name('product_statusNum'); |
| 209 | Route::any('/copyProduct', [\App\Http\Controllers\Bside\Product\ProductController::class, 'copyProduct'])->name('product_copyProduct'); | 212 | Route::any('/copyProduct', [\App\Http\Controllers\Bside\Product\ProductController::class, 'copyProduct'])->name('product_copyProduct'); |
-
请 注册 或 登录 后发表评论