作者 lyh

gx

... ... @@ -37,7 +37,8 @@ class BlogController extends BaseController
$user = new User();
foreach ($lists['list'] as $k => $v){
$v['category_name'] = $this->categoryName($v['category_id'],$data);
$v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);
$v['route'] = getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);
$v['url'] = $this->user['domain'] . $v['route'];
$v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
$v['operator_name'] = $user->getName($v['operator_id']);
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id,$v['id']);
... ...
... ... @@ -41,7 +41,8 @@ class NewsController extends BaseController
$user = new User();
foreach ($lists['list'] as $k => $v){
$v['category_name'] = $this->categoryName($v['category_id'],$data);
$v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
$v['route'] = getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
$v['url'] = $this->user['domain'].$v['route'];
$v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
$v['operator_name'] = $user->getName($v['operator_id']);
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id,$v['id']);
... ...
... ... @@ -73,20 +73,15 @@ class ReplaceHtmlLogic extends BaseLogic
$this->fail('当前类型不存在,请联系管理员');
}
$template_id = $this->getTemplateId($typeInfo);
//TODO::生成一条任务记录
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);
//查询当前类型所有装修的记录
$bTemplateModel = new BTemplate();
$condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
$list = $bTemplateModel->list($condition);
//TODO::生成一条任务记录
$total_num = count($list);
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
foreach ($list as $v){
if($v['type'] == 0){
$main_html = str_replace($this->param['old_html'],$this->param['html'],$v['main_html']);
$this->model->edit(['main_html'=>$main_html],['id'=>$v['id']]);
}else{
$html = str_replace($this->param['old_html'],$this->param['html'],$v['html']);
$this->model->edit(['html'=>$html],['id'=>$v['id']]);
}
//生成子任务
$this->saveReplaceHtmlLog($replaceId,$v['id']);
}
return $this->success();
... ... @@ -99,15 +94,17 @@ class ReplaceHtmlLogic extends BaseLogic
* @method :post
* @time :2024/5/8 9:23
*/
public function saveReplaceHtml($param,$data,$template_id){
public function saveReplaceHtml($param,$data,$template_id,$total_num){
$logData = [
'type'=>$data['type'],
'is_custom'=>$data['is_custom'],
'is_list'=>$data['is_list'],
'template_id'=>$template_id,
'status'=>BTemplate::STATUS,
'old_html'=>$param['old_html'],
'html'=>$param['html'],
'project_id'=>$param['project_id'],
'total_num'=>$total_num,
];
return $this->model->addReturnId($logData);
}
... ...
... ... @@ -45,7 +45,7 @@ class ProductLogic extends BaseLogic
$category_ids = $this->handleCategory();
//处理其他字段
$this->param = $this->handleSaveParam($this->param);
try {
// try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
... ... @@ -66,10 +66,10 @@ class ProductLogic extends BaseLogic
CategoryRelated::saveRelated($id, $category_ids);
//保存扩展字段
$this->saveExtendInfo($id,$extend);
}catch (\Exception $e){
Log::info('错误信息---'.$e->getMessage());
$this->fail('系统错误,请联系管理员');
}
// }catch (\Exception $e){
// Log::info('错误信息---'.$e->getMessage());
// $this->fail('系统错误,请联系管理员');
// }
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route);
$this->curlDelRoute(['new_route'=>$route]);
return $this->success(['id'=>$id]);
... ...