作者 lyh

gx

@@ -12,7 +12,10 @@ namespace App\Http\Controllers\Bside\CustomModule; @@ -12,7 +12,10 @@ namespace App\Http\Controllers\Bside\CustomModule;
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Http\Controllers\Bside\BaseController; 13 use App\Http\Controllers\Bside\BaseController;
14 use App\Http\Logic\Bside\CustomModule\CustomModuleCategoryLogic; 14 use App\Http\Logic\Bside\CustomModule\CustomModuleCategoryLogic;
  15 +use App\Models\CustomModule\CustomModule;
15 use App\Models\CustomModule\CustomModuleCategory; 16 use App\Models\CustomModule\CustomModuleCategory;
  17 +use App\Models\Template\BTemplate;
  18 +use App\Models\Template\Setting;
16 use App\Models\User\User; 19 use App\Models\User\User;
17 20
18 class CustomModuleCategoryController extends BaseController 21 class CustomModuleCategoryController extends BaseController
@@ -34,7 +37,9 @@ class CustomModuleCategoryController extends BaseController @@ -34,7 +37,9 @@ class CustomModuleCategoryController extends BaseController
34 $this->map['status'] = 0; 37 $this->map['status'] = 0;
35 $list = $customModuleCategory->list($this->map,'sort'); 38 $list = $customModuleCategory->list($this->map,'sort');
36 if(!empty($list)){ 39 if(!empty($list)){
  40 + $template_id = $this->getModuleTemplateId($this->param['module_id']);
37 foreach ($list as $k => $v){ 41 foreach ($list as $k => $v){
  42 + $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM);
38 $v['url'] = $this->user['domain'].$v['route']; 43 $v['url'] = $this->user['domain'].$v['route'];
39 $list[$k] = $v; 44 $list[$k] = $v;
40 } 45 }
@@ -44,6 +49,25 @@ class CustomModuleCategoryController extends BaseController @@ -44,6 +49,25 @@ class CustomModuleCategoryController extends BaseController
44 } 49 }
45 50
46 /** 51 /**
  52 + * @remark :扩展模块获取模版id
  53 + * @name :getTemplateId
  54 + * @author :lyh
  55 + * @method :post
  56 + * @time :2024/1/31 16:47
  57 + */
  58 + public function getModuleTemplateId($module_id){
  59 + $template_id = 0;
  60 + $moduleModel = new CustomModule();
  61 + $info = $moduleModel->read(['id'=>$module_id]);
  62 + if($info['list_customized'] != 1){
  63 + $bSettingModel = new Setting();
  64 + $info = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
  65 + $template_id = $info['template_id'];
  66 + }
  67 + return $this->success($template_id);
  68 + }
  69 +
  70 + /**
47 * @remark :无分页子集处理 71 * @remark :无分页子集处理
48 * @name :getListSon 72 * @name :getListSon
49 * @author :lyh 73 * @author :lyh
@@ -12,9 +12,12 @@ namespace App\Http\Controllers\Bside\CustomModule; @@ -12,9 +12,12 @@ namespace App\Http\Controllers\Bside\CustomModule;
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Http\Controllers\Bside\BaseController; 13 use App\Http\Controllers\Bside\BaseController;
14 use App\Http\Logic\Bside\CustomModule\CustomModuleContentLogic; 14 use App\Http\Logic\Bside\CustomModule\CustomModuleContentLogic;
  15 +use App\Models\CustomModule\CustomModule;
15 use App\Models\CustomModule\CustomModuleCategory; 16 use App\Models\CustomModule\CustomModuleCategory;
16 use App\Models\CustomModule\CustomModuleContent; 17 use App\Models\CustomModule\CustomModuleContent;
17 use App\Models\RouteMap\RouteMap; 18 use App\Models\RouteMap\RouteMap;
  19 +use App\Models\Template\BTemplate;
  20 +use App\Models\Template\Setting;
18 use App\Models\User\User; 21 use App\Models\User\User;
19 22
20 class CustomModuleContentController extends BaseController 23 class CustomModuleContentController extends BaseController
@@ -35,12 +38,14 @@ class CustomModuleContentController extends BaseController @@ -35,12 +38,14 @@ class CustomModuleContentController extends BaseController
35 $this->map['project_id'] = $this->user['project_id']; 38 $this->map['project_id'] = $this->user['project_id'];
36 $lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order = ['sort','id']); 39 $lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order = ['sort','id']);
37 if(!empty($lists)){ 40 if(!empty($lists)){
  41 + $template_id = $this->getModuleTemplateId($this->param['module_id']);
38 $data = $this->getAllCategoryName(); 42 $data = $this->getAllCategoryName();
39 foreach ($lists['list'] as $k=>$v){ 43 foreach ($lists['list'] as $k=>$v){
40 $v['url'] = $this->getUrl($v); 44 $v['url'] = $this->getUrl($v);
41 $v = $this->getHandleImageFile($v); 45 $v = $this->getHandleImageFile($v);
42 $v['category_name'] = $this->categoryName($v['category_id'],$data); 46 $v['category_name'] = $this->categoryName($v['category_id'],$data);
43 $v['operator_name'] = (new User())->getName($v['operator_id']); 47 $v['operator_name'] = (new User())->getName($v['operator_id']);
  48 + $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_DETAIL,$template_id,$v['id'],BTemplate::IS_CUSTOM);
44 $lists['list'][$k] = $v; 49 $lists['list'][$k] = $v;
45 } 50 }
46 } 51 }
@@ -48,6 +53,25 @@ class CustomModuleContentController extends BaseController @@ -48,6 +53,25 @@ class CustomModuleContentController extends BaseController
48 } 53 }
49 54
50 /** 55 /**
  56 + * @remark :扩展模块获取模版id
  57 + * @name :getTemplateId
  58 + * @author :lyh
  59 + * @method :post
  60 + * @time :2024/1/31 16:47
  61 + */
  62 + public function getModuleTemplateId($module_id){
  63 + $template_id = 0;
  64 + $moduleModel = new CustomModule();
  65 + $info = $moduleModel->read(['id'=>$module_id]);
  66 + if($info['detail_customized'] != 1){
  67 + $bSettingModel = new Setting();
  68 + $info = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
  69 + $template_id = $info['template_id'];
  70 + }
  71 + return $this->success($template_id);
  72 + }
  73 +
  74 + /**
51 * @remark :获取时处理视频,图片,文件 75 * @remark :获取时处理视频,图片,文件
52 * @name :getHandleImageFile 76 * @name :getHandleImageFile
53 * @author :lyh 77 * @author :lyh