作者 lyh

gx

@@ -37,7 +37,8 @@ class BlogController extends BaseController @@ -37,7 +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['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG,$v['id']); 40 + $v['route'] = getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);
  41 + $v['url'] = $this->user['domain'] . $v['route'];
41 $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']);
42 $v['operator_name'] = $user->getName($v['operator_id']); 43 $v['operator_name'] = $user->getName($v['operator_id']);
43 $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,7 +41,8 @@ class NewsController extends BaseController @@ -41,7 +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['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']); 44 + $v['route'] = getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
  45 + $v['url'] = $this->user['domain'].$v['route'];
45 $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']);
46 $v['operator_name'] = $user->getName($v['operator_id']); 47 $v['operator_name'] = $user->getName($v['operator_id']);
47 $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']);
@@ -73,20 +73,15 @@ class ReplaceHtmlLogic extends BaseLogic @@ -73,20 +73,15 @@ class ReplaceHtmlLogic extends BaseLogic
73 $this->fail('当前类型不存在,请联系管理员'); 73 $this->fail('当前类型不存在,请联系管理员');
74 } 74 }
75 $template_id = $this->getTemplateId($typeInfo); 75 $template_id = $this->getTemplateId($typeInfo);
76 - //TODO::生成一条任务记录  
77 - $replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);  
78 //查询当前类型所有装修的记录 76 //查询当前类型所有装修的记录
79 $bTemplateModel = new BTemplate(); 77 $bTemplateModel = new BTemplate();
80 $condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id]; 78 $condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
81 $list = $bTemplateModel->list($condition); 79 $list = $bTemplateModel->list($condition);
  80 + //TODO::生成一条任务记录
  81 + $total_num = count($list);
  82 + $replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
82 foreach ($list as $v){ 83 foreach ($list as $v){
83 - if($v['type'] == 0){  
84 - $main_html = str_replace($this->param['old_html'],$this->param['html'],$v['main_html']);  
85 - $this->model->edit(['main_html'=>$main_html],['id'=>$v['id']]);  
86 - }else{  
87 - $html = str_replace($this->param['old_html'],$this->param['html'],$v['html']);  
88 - $this->model->edit(['html'=>$html],['id'=>$v['id']]);  
89 - } 84 + //生成子任务
90 $this->saveReplaceHtmlLog($replaceId,$v['id']); 85 $this->saveReplaceHtmlLog($replaceId,$v['id']);
91 } 86 }
92 return $this->success(); 87 return $this->success();
@@ -99,15 +94,17 @@ class ReplaceHtmlLogic extends BaseLogic @@ -99,15 +94,17 @@ class ReplaceHtmlLogic extends BaseLogic
99 * @method :post 94 * @method :post
100 * @time :2024/5/8 9:23 95 * @time :2024/5/8 9:23
101 */ 96 */
102 - public function saveReplaceHtml($param,$data,$template_id){ 97 + public function saveReplaceHtml($param,$data,$template_id,$total_num){
103 $logData = [ 98 $logData = [
104 'type'=>$data['type'], 99 'type'=>$data['type'],
105 'is_custom'=>$data['is_custom'], 100 'is_custom'=>$data['is_custom'],
106 'is_list'=>$data['is_list'], 101 'is_list'=>$data['is_list'],
107 'template_id'=>$template_id, 102 'template_id'=>$template_id,
  103 + 'status'=>BTemplate::STATUS,
108 'old_html'=>$param['old_html'], 104 'old_html'=>$param['old_html'],
109 'html'=>$param['html'], 105 'html'=>$param['html'],
110 'project_id'=>$param['project_id'], 106 'project_id'=>$param['project_id'],
  107 + 'total_num'=>$total_num,
111 ]; 108 ];
112 return $this->model->addReturnId($logData); 109 return $this->model->addReturnId($logData);
113 } 110 }
@@ -45,7 +45,7 @@ class ProductLogic extends BaseLogic @@ -45,7 +45,7 @@ class ProductLogic extends BaseLogic
45 $category_ids = $this->handleCategory(); 45 $category_ids = $this->handleCategory();
46 //处理其他字段 46 //处理其他字段
47 $this->param = $this->handleSaveParam($this->param); 47 $this->param = $this->handleSaveParam($this->param);
48 - try { 48 +// try {
49 if(isset($this->param['id']) && !empty($this->param['id'])){ 49 if(isset($this->param['id']) && !empty($this->param['id'])){
50 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 50 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
51 $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 51 $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
@@ -66,10 +66,10 @@ class ProductLogic extends BaseLogic @@ -66,10 +66,10 @@ class ProductLogic extends BaseLogic
66 CategoryRelated::saveRelated($id, $category_ids); 66 CategoryRelated::saveRelated($id, $category_ids);
67 //保存扩展字段 67 //保存扩展字段
68 $this->saveExtendInfo($id,$extend); 68 $this->saveExtendInfo($id,$extend);
69 - }catch (\Exception $e){  
70 - Log::info('错误信息---'.$e->getMessage());  
71 - $this->fail('系统错误,请联系管理员');  
72 - } 69 +// }catch (\Exception $e){
  70 +// Log::info('错误信息---'.$e->getMessage());
  71 +// $this->fail('系统错误,请联系管理员');
  72 +// }
73 $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); 73 $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route);
74 $this->curlDelRoute(['new_route'=>$route]); 74 $this->curlDelRoute(['new_route'=>$route]);
75 return $this->success(['id'=>$id]); 75 return $this->success(['id'=>$id]);