|
...
|
...
|
@@ -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);
|
...
|
...
|
|