作者 lyh

gx

@@ -37,8 +37,8 @@ class BlogController extends BaseController @@ -37,8 +37,8 @@ class BlogController extends BaseController
37 $user = new User(); 37 $user = new User();
38 foreach ($lists['list'] as $k => $v){ 38 foreach ($lists['list'] as $k => $v){
39 $v['category_name'] = $this->categoryName($v['category_id'],$data); 39 $v['category_name'] = $this->categoryName($v['category_id'],$data);
40 - $v['route'] = getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);  
41 - $v['url'] = $this->user['domain'] . $v['route']; 40 + $v['route'] = $v['url'];
  41 + $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);;
42 $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); 42 $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
43 $v['operator_name'] = $user->getName($v['operator_id']); 43 $v['operator_name'] = $user->getName($v['operator_id']);
44 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id,$v['id']); 44 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id,$v['id']);
@@ -41,8 +41,8 @@ class NewsController extends BaseController @@ -41,8 +41,8 @@ class NewsController extends BaseController
41 $user = new User(); 41 $user = new User();
42 foreach ($lists['list'] as $k => $v){ 42 foreach ($lists['list'] as $k => $v){
43 $v['category_name'] = $this->categoryName($v['category_id'],$data); 43 $v['category_name'] = $this->categoryName($v['category_id'],$data);
44 - $v['route'] = getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);  
45 - $v['url'] = $this->user['domain'].$v['route']; 44 + $v['route'] = $v['url'];
  45 + $v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
46 $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); 46 $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
47 $v['operator_name'] = $user->getName($v['operator_id']); 47 $v['operator_name'] = $user->getName($v['operator_id']);
48 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id,$v['id']); 48 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id,$v['id']);
@@ -74,15 +74,17 @@ class ReplaceHtmlLogic extends BaseLogic @@ -74,15 +74,17 @@ class ReplaceHtmlLogic extends BaseLogic
74 } 74 }
75 $template_id = $this->getTemplateId($typeInfo); 75 $template_id = $this->getTemplateId($typeInfo);
76 //查询当前类型所有装修的记录 76 //查询当前类型所有装修的记录
  77 + ProjectServer::useProject($this->param['project_id']);
77 $bTemplateModel = new BTemplate(); 78 $bTemplateModel = new BTemplate();
78 - $condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id]; 79 + $condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
79 $list = $bTemplateModel->list($condition); 80 $list = $bTemplateModel->list($condition);
  81 + DB::disconnect('custom_mysql');
80 //TODO::生成一条任务记录 82 //TODO::生成一条任务记录
81 $total_num = count($list); 83 $total_num = count($list);
82 $replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num); 84 $replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
83 foreach ($list as $v){ 85 foreach ($list as $v){
84 //生成子任务 86 //生成子任务
85 - $this->saveReplaceHtmlLog($replaceId,$v['id']); 87 + $this->saveReplaceHtmlLog($replaceId,$v);
86 } 88 }
87 return $this->success(); 89 return $this->success();
88 } 90 }
@@ -94,11 +96,11 @@ class ReplaceHtmlLogic extends BaseLogic @@ -94,11 +96,11 @@ class ReplaceHtmlLogic extends BaseLogic
94 * @method :post 96 * @method :post
95 * @time :2024/5/8 9:23 97 * @time :2024/5/8 9:23
96 */ 98 */
97 - public function saveReplaceHtml($param,$data,$template_id,$total_num){ 99 + public function saveReplaceHtml($param,$typeInfo,$template_id,$total_num){
98 $logData = [ 100 $logData = [
99 - 'type'=>$data['type'],  
100 - 'is_custom'=>$data['is_custom'],  
101 - 'is_list'=>$data['is_list'], 101 + 'source'=>$typeInfo['source'],
  102 + 'is_custom'=>$typeInfo['is_custom'],
  103 + 'is_list'=>$typeInfo['is_list'],
102 'template_id'=>$template_id, 104 'template_id'=>$template_id,
103 'status'=>BTemplate::STATUS, 105 'status'=>BTemplate::STATUS,
104 'old_html'=>$param['old_html'], 106 'old_html'=>$param['old_html'],
@@ -116,16 +118,14 @@ class ReplaceHtmlLogic extends BaseLogic @@ -116,16 +118,14 @@ class ReplaceHtmlLogic extends BaseLogic
116 * @method :post 118 * @method :post
117 * @time :2024/5/8 9:37 119 * @time :2024/5/8 9:37
118 */ 120 */
119 - public function saveReplaceHtmlLog($replace_id,$replace_template_id){  
120 - ProjectServer::useProject($this->param['project_id']); 121 + public function saveReplaceHtmlLog($replace_id,$replace_template_id,$typeInfo){
121 $logData = [ 122 $logData = [
122 'replace_id'=>$replace_id, 123 'replace_id'=>$replace_id,
123 - 'replace_template_id'=>$replace_template_id, 124 + 'source'=>$replace_template_id,
124 'uid'=>$this->user['manager_id'], 125 'uid'=>$this->user['manager_id'],
125 ]; 126 ];
126 $replaceHtmlModel = new TemplateReplaceHtmlLog(); 127 $replaceHtmlModel = new TemplateReplaceHtmlLog();
127 $save_id = $replaceHtmlModel->addReturnId($logData); 128 $save_id = $replaceHtmlModel->addReturnId($logData);
128 - DB::disconnect('custom_mysql');  
129 return $this->success($save_id); 129 return $this->success($save_id);
130 } 130 }
131 131
@@ -201,8 +201,8 @@ class ReplaceHtmlLogic extends BaseLogic @@ -201,8 +201,8 @@ class ReplaceHtmlLogic extends BaseLogic
201 $customModule = new CustomModule(); 201 $customModule = new CustomModule();
202 $moduleList = $customModule->list(['project_id'=>$this->param['project_id']],'id',['id','name']); 202 $moduleList = $customModule->list(['project_id'=>$this->param['project_id']],'id',['id','name']);
203 foreach ($moduleList as $value){ 203 foreach ($moduleList as $value){
204 - $data[$value['name'].'详情'] = ['type'=>$value['id'],'is_list'=>0,'is_custom'=>1];  
205 - $data[$value['name'].'列表'] = ['type'=>$value['id'],'is_list'=>1,'is_custom'=>1]; 204 + $data[$value['name'].'详情'] = ['source'=>$value['id'],'is_list'=>0,'is_custom'=>1];
  205 + $data[$value['name'].'列表'] = ['source'=>$value['id'],'is_list'=>1,'is_custom'=>1];
206 } 206 }
207 DB::disconnect('custom_mysql'); 207 DB::disconnect('custom_mysql');
208 return $this->success($data); 208 return $this->success($data);
@@ -23,14 +23,14 @@ class TemplateReplaceHtml extends Base @@ -23,14 +23,14 @@ class TemplateReplaceHtml extends Base
23 */ 23 */
24 public function sourceType(){ 24 public function sourceType(){
25 return [ 25 return [
26 - '首页'=>['type'=>1,'is_list'=>0,'is_custom'=>0],  
27 - '产品详情'=>['type'=>2,'is_list'=>0,'is_custom'=>0],  
28 - '产品列表'=>['type'=>2,'is_list'=>1,'is_custom'=>0],  
29 - '新闻详情'=>['type'=>4,'is_list'=>0,'is_custom'=>0],  
30 - '新闻列表'=>['type'=>4,'is_list'=>1,'is_custom'=>0],  
31 - '博客详情'=>['type'=>3,'is_list'=>0,'is_custom'=>0],  
32 - '博客列表'=>['type'=>3,'is_list'=>1,'is_custom'=>0],  
33 - '单页面'=>['type'=>9,'is_list'=>0,'is_custom'=>0], 26 + '首页'=>['source'=>1,'is_list'=>0,'is_custom'=>0],
  27 + '产品详情'=>['source'=>2,'is_list'=>0,'is_custom'=>0],
  28 + '产品列表'=>['source'=>2,'is_list'=>1,'is_custom'=>0],
  29 + '新闻详情'=>['source'=>4,'is_list'=>0,'is_custom'=>0],
  30 + '新闻列表'=>['source'=>4,'is_list'=>1,'is_custom'=>0],
  31 + '博客详情'=>['source'=>3,'is_list'=>0,'is_custom'=>0],
  32 + '博客列表'=>['source'=>3,'is_list'=>1,'is_custom'=>0],
  33 + '单页面'=>['source'=>9,'is_list'=>0,'is_custom'=>0],
34 ]; 34 ];
35 } 35 }
36 } 36 }