作者 lyh

gx

... ... @@ -37,8 +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['route'] = getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);
$v['url'] = $this->user['domain'] . $v['route'];
$v['route'] = $v['url'];
$v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);;
$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,8 +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['route'] = getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
$v['url'] = $this->user['domain'].$v['route'];
$v['route'] = $v['url'];
$v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
$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']);
... ...
... ... @@ -74,15 +74,17 @@ class ReplaceHtmlLogic extends BaseLogic
}
$template_id = $this->getTemplateId($typeInfo);
//查询当前类型所有装修的记录
ProjectServer::useProject($this->param['project_id']);
$bTemplateModel = new BTemplate();
$condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
$condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
$list = $bTemplateModel->list($condition);
DB::disconnect('custom_mysql');
//TODO::生成一条任务记录
$total_num = count($list);
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
foreach ($list as $v){
//生成子任务
$this->saveReplaceHtmlLog($replaceId,$v['id']);
$this->saveReplaceHtmlLog($replaceId,$v);
}
return $this->success();
}
... ... @@ -94,11 +96,11 @@ class ReplaceHtmlLogic extends BaseLogic
* @method :post
* @time :2024/5/8 9:23
*/
public function saveReplaceHtml($param,$data,$template_id,$total_num){
public function saveReplaceHtml($param,$typeInfo,$template_id,$total_num){
$logData = [
'type'=>$data['type'],
'is_custom'=>$data['is_custom'],
'is_list'=>$data['is_list'],
'source'=>$typeInfo['source'],
'is_custom'=>$typeInfo['is_custom'],
'is_list'=>$typeInfo['is_list'],
'template_id'=>$template_id,
'status'=>BTemplate::STATUS,
'old_html'=>$param['old_html'],
... ... @@ -116,16 +118,14 @@ class ReplaceHtmlLogic extends BaseLogic
* @method :post
* @time :2024/5/8 9:37
*/
public function saveReplaceHtmlLog($replace_id,$replace_template_id){
ProjectServer::useProject($this->param['project_id']);
public function saveReplaceHtmlLog($replace_id,$replace_template_id,$typeInfo){
$logData = [
'replace_id'=>$replace_id,
'replace_template_id'=>$replace_template_id,
'source'=>$replace_template_id,
'uid'=>$this->user['manager_id'],
];
$replaceHtmlModel = new TemplateReplaceHtmlLog();
$save_id = $replaceHtmlModel->addReturnId($logData);
DB::disconnect('custom_mysql');
return $this->success($save_id);
}
... ... @@ -201,8 +201,8 @@ class ReplaceHtmlLogic extends BaseLogic
$customModule = new CustomModule();
$moduleList = $customModule->list(['project_id'=>$this->param['project_id']],'id',['id','name']);
foreach ($moduleList as $value){
$data[$value['name'].'详情'] = ['type'=>$value['id'],'is_list'=>0,'is_custom'=>1];
$data[$value['name'].'列表'] = ['type'=>$value['id'],'is_list'=>1,'is_custom'=>1];
$data[$value['name'].'详情'] = ['source'=>$value['id'],'is_list'=>0,'is_custom'=>1];
$data[$value['name'].'列表'] = ['source'=>$value['id'],'is_list'=>1,'is_custom'=>1];
}
DB::disconnect('custom_mysql');
return $this->success($data);
... ...
... ... @@ -23,14 +23,14 @@ class TemplateReplaceHtml extends Base
*/
public function sourceType(){
return [
'首页'=>['type'=>1,'is_list'=>0,'is_custom'=>0],
'产品详情'=>['type'=>2,'is_list'=>0,'is_custom'=>0],
'产品列表'=>['type'=>2,'is_list'=>1,'is_custom'=>0],
'新闻详情'=>['type'=>4,'is_list'=>0,'is_custom'=>0],
'新闻列表'=>['type'=>4,'is_list'=>1,'is_custom'=>0],
'博客详情'=>['type'=>3,'is_list'=>0,'is_custom'=>0],
'博客列表'=>['type'=>3,'is_list'=>1,'is_custom'=>0],
'单页面'=>['type'=>9,'is_list'=>0,'is_custom'=>0],
'首页'=>['source'=>1,'is_list'=>0,'is_custom'=>0],
'产品详情'=>['source'=>2,'is_list'=>0,'is_custom'=>0],
'产品列表'=>['source'=>2,'is_list'=>1,'is_custom'=>0],
'新闻详情'=>['source'=>4,'is_list'=>0,'is_custom'=>0],
'新闻列表'=>['source'=>4,'is_list'=>1,'is_custom'=>0],
'博客详情'=>['source'=>3,'is_list'=>0,'is_custom'=>0],
'博客列表'=>['source'=>3,'is_list'=>1,'is_custom'=>0],
'单页面'=>['source'=>9,'is_list'=>0,'is_custom'=>0],
];
}
}
... ...