作者 赵彬吉
@@ -2,21 +2,10 @@ @@ -2,21 +2,10 @@
2 2
3 namespace App\Console\Commands; 3 namespace App\Console\Commands;
4 4
5 -use App\Helper\Arr;  
6 -use App\Helper\Common;  
7 -use App\Helper\Gpt;  
8 -use App\Helper\Translate;  
9 -use App\Http\Logic\Aside\Project\ProjectLogic;  
10 -use App\Models\Ai\AiCommand;  
11 -use App\Models\Mail\Mail;  
12 -use App\Models\Project\DeployOptimize;  
13 -use App\Models\Project\ProjectUpdateTdk;  
14 -use App\Models\User\User; 5 +
15 use App\Services\ProjectServer; 6 use App\Services\ProjectServer;
16 use Illuminate\Console\Command; 7 use Illuminate\Console\Command;
17 -use Illuminate\Support\Facades\Cache;  
18 use Illuminate\Support\Facades\DB; 8 use Illuminate\Support\Facades\DB;
19 -use Illuminate\Support\Facades\Redis;  
20 9
21 /** 10 /**
22 * 清除项目sdk 11 * 清除项目sdk
@@ -30,7 +30,7 @@ class SyncMobile extends Command @@ -30,7 +30,7 @@ class SyncMobile extends Command
30 protected $description = '同步手机号码库'; 30 protected $description = '同步手机号码库';
31 31
32 /** 32 /**
33 - * @remark :统一更新路由 33 + * @remark :统一更新
34 * @name :handle 34 * @name :handle
35 * @author :lyh 35 * @author :lyh
36 * @method :post 36 * @method :post
@@ -2,21 +2,10 @@ @@ -2,21 +2,10 @@
2 2
3 namespace App\Console\Commands; 3 namespace App\Console\Commands;
4 4
5 -use App\Helper\Arr;  
6 -use App\Helper\Common;  
7 -use App\Helper\Gpt;  
8 -use App\Helper\Translate;  
9 -use App\Models\Ai\AiCommand;  
10 -use App\Models\Mail\Mail;  
11 -use App\Models\Project\DeployOptimize;  
12 use App\Models\Project\Project; 5 use App\Models\Project\Project;
13 -use App\Models\Project\ProjectUpdateTdk;  
14 -use App\Models\User\User;  
15 use App\Services\ProjectServer; 6 use App\Services\ProjectServer;
16 use Illuminate\Console\Command; 7 use Illuminate\Console\Command;
17 -use Illuminate\Support\Facades\Cache;  
18 use Illuminate\Support\Facades\DB; 8 use Illuminate\Support\Facades\DB;
19 -use Illuminate\Support\Facades\Redis;  
20 9
21 /** 10 /**
22 * 初始化项目 11 * 初始化项目
@@ -2,21 +2,9 @@ @@ -2,21 +2,9 @@
2 2
3 namespace App\Console\Commands; 3 namespace App\Console\Commands;
4 4
5 -use App\Helper\Arr;  
6 -use App\Helper\Common;  
7 -use App\Helper\Gpt;  
8 -use App\Helper\Translate;  
9 -use App\Models\Ai\AiCommand;  
10 -use App\Models\Mail\Mail;  
11 -use App\Models\Project\DeployOptimize;  
12 use App\Models\Project\Project; 5 use App\Models\Project\Project;
13 use App\Models\Project\ProjectUpdateTdk; 6 use App\Models\Project\ProjectUpdateTdk;
14 -use App\Models\User\User;  
15 -use App\Services\ProjectServer;  
16 use Illuminate\Console\Command; 7 use Illuminate\Console\Command;
17 -use Illuminate\Support\Facades\Cache;  
18 -use Illuminate\Support\Facades\DB;  
19 -use Illuminate\Support\Facades\Redis;  
20 8
21 /** 9 /**
22 * 初始化项目 10 * 初始化项目
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :UpdateHtml.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/2/2 10:11
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Html;
  11 +
  12 +use App\Http\Controllers\Controller;
  13 +use App\Models\Com\NoticeLog;
  14 +use App\Models\Project\Project;
  15 +use App\Models\RouteMap\RouteMap;
  16 +use App\Models\Service\Service as ServiceSettingModel;
  17 +use App\Models\Template\BTemplate;
  18 +use App\Services\ProjectServer;
  19 +use Illuminate\Support\Facades\DB;
  20 +
  21 +class UpdateHtml extends Controller
  22 +{
  23 + protected $param;
  24 + protected $project_id;
  25 + public function __construct($data){
  26 + $this->param = $data;//Todo::传递的参数
  27 + $this->project_id = $data['project_id'];
  28 + }
  29 +
  30 + /**
  31 + * @remark :更新界面
  32 + * @name :updateHtml
  33 + * @author :lyh
  34 + * @method :post
  35 + * @time :2024/2/2 10:12
  36 + */
  37 + public function updateHtml(){
  38 + ProjectServer::useProject($this->project_id);
  39 + if(isset($this->param['route']) && $this->param['route'] == 'all'){
  40 + //TODO::更新所有界面
  41 + }else{
  42 + //TODO::更新单页
  43 + $routeMapModel = new RouteMap();
  44 + }
  45 + DB::disconnect('custom_mysql');
  46 + }
  47 +
  48 + /**
  49 + * @remark :获取页面是否为 定制/非定制 页面
  50 + * @name :getPageHtmlIsCustomized
  51 + * @param :source:类型;is_list:是否为列表页 1:列表页面
  52 + * @author :lyh
  53 + * @method :post
  54 + * @time :2024/2/2 11:03
  55 + */
  56 + public function getPageHtmlIsCustomized($source,$is_list){
  57 + $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
  58 + //查看当前页面是否定制,是否开启可视化
  59 + $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
  60 + if (in_array($type, $page_array)) {//是定制界面
  61 + return BTemplate::IS_VISUALIZATION;
  62 + }
  63 + return BTemplate::IS_NO_VISUALIZATION;
  64 + }
  65 +
  66 + /**
  67 + * @remark :获取头部底部公共部分代码
  68 + * @name :getTemplateCommon
  69 + * @author :lyh
  70 + * @method :post
  71 + * @time :2024/2/2 11:02
  72 + */
  73 + public function getTemplateCommon(){
  74 +
  75 + }
  76 +
  77 + /**
  78 + * @remark :获取装修中间内容
  79 + * @name :getTemplateMainHtml
  80 + * @author :lyh
  81 + * @method :post
  82 + * @time :2024/2/2 11:01
  83 + */
  84 + public function getTemplateMainHtml(){
  85 +
  86 + }
  87 +
  88 + /**
  89 + * @remark :获取项目详情
  90 + * @name :getProjectInfo
  91 + * @author :lyh
  92 + * @method :post
  93 + * @time :2024/2/2 10:50
  94 + */
  95 + public function getProjectInfo($project_id){
  96 + $projectModel = new Project();
  97 + $info = $projectModel->read(['id'=>$project_id],['id','is_customized']);
  98 + return $info;
  99 + }
  100 +
  101 + /**
  102 + * @remark :拼接获取公共头部底部
  103 + * @name :getHeadFooter
  104 + * @author :lyh
  105 + * @method :post
  106 + * @time :2023/7/21 17:22
  107 + */
  108 + public function getHeadFooter($html){
  109 + //获取公共主题头部底部
  110 + $serviceSettingModel = new ServiceSettingModel();
  111 + $list = $serviceSettingModel->list(['type'=>2],'created_at');
  112 + //拼接html
  113 + foreach ($list as $v){
  114 + if($v['key'] == 'head'){
  115 + $html = $v['values'].$html;
  116 + }
  117 + if($v['key'] == 'footer'){
  118 + $html = $html.$v['values'];
  119 + }
  120 + }
  121 + return $html;
  122 + }
  123 +}
@@ -142,7 +142,11 @@ class BTemplateLogic extends BaseLogic @@ -142,7 +142,11 @@ class BTemplateLogic extends BaseLogic
142 $this->fail('当前扩展模块不存在或已被删除'); 142 $this->fail('当前扩展模块不存在或已被删除');
143 } 143 }
144 //扩展模块定制 144 //扩展模块定制
145 - if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION){ 145 + if($is_list == BTemplate::IS_LIST && $info['list_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 + if($is_list == BTemplate::IS_DETAIL && $info['detail_customized'] == BTemplate::IS_VISUALIZATION){
146 $html = $this->customModuleCustomizeHtml($source,$is_list,$is_custom); 150 $html = $this->customModuleCustomizeHtml($source,$is_list,$is_custom);
147 return $this->success(['html'=>$html,'template_id'=>$template_id]); 151 return $this->success(['html'=>$html,'template_id'=>$template_id]);
148 } 152 }
@@ -363,6 +367,9 @@ class BTemplateLogic extends BaseLogic @@ -363,6 +367,9 @@ class BTemplateLogic extends BaseLogic
363 'type'=>$type, 367 'type'=>$type,
364 'is_custom'=>0, 368 'is_custom'=>0,
365 ]; 369 ];
  370 + if($this->user['project_id'] == 427){
  371 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
  372 + }
366 $commonTemplateModel = new BTemplateCommon(); 373 $commonTemplateModel = new BTemplateCommon();
367 $commonInfo = $commonTemplateModel->read($data); 374 $commonInfo = $commonTemplateModel->read($data);
368 if($commonInfo === false){ 375 if($commonInfo === false){
@@ -51,6 +51,8 @@ class BTemplate extends Base @@ -51,6 +51,8 @@ class BTemplate extends Base
51 const IS_CUSTOM = 1;//为扩展模块 51 const IS_CUSTOM = 1;//为扩展模块
52 const IS_NO_CUSTOM = 0;//为默认模块 52 const IS_NO_CUSTOM = 0;//为默认模块
53 const IS_VISUALIZATION = 1;//定制项目 53 const IS_VISUALIZATION = 1;//定制项目
  54 +
  55 + const IS_NO_VISUALIZATION = 1;//定制项目
54 const STATUS = 0; 56 const STATUS = 0;
55 57
56 /** 58 /**
@@ -2,14 +2,11 @@ @@ -2,14 +2,11 @@
2 2
3 namespace App\Models\User; 3 namespace App\Models\User;
4 4
5 -//use Illuminate\Contracts\Auth\MustVerifyEmail;  
6 use App\Models\Base; 5 use App\Models\Base;
7 6
8 -//use Illuminate\Foundation\Auth\User as Authenticatable;  
9 7
10 class User extends Base 8 class User extends Base
11 { 9 {
12 -// use HasApiTokens, HasFactory, Notifiable;  
13 const ROLE_MANAGER = 0;//超级管理员 10 const ROLE_MANAGER = 0;//超级管理员
14 const TYPE_ONE = 1; 11 const TYPE_ONE = 1;
15 12