|
@@ -66,7 +66,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -66,7 +66,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
66
|
* @time :2024/5/7 15:52
|
66
|
* @time :2024/5/7 15:52
|
|
67
|
*/
|
67
|
*/
|
|
68
|
public function replaceTemplateMainHtml(){
|
68
|
public function replaceTemplateMainHtml(){
|
|
69
|
-
|
|
|
|
70
|
$data = $this->sourceTypeInfo();
|
69
|
$data = $this->sourceTypeInfo();
|
|
71
|
$typeInfo = $data[$this->param['name']];
|
70
|
$typeInfo = $data[$this->param['name']];
|
|
72
|
if(!isset($typeInfo)){
|
71
|
if(!isset($typeInfo)){
|
|
@@ -76,15 +75,16 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -76,15 +75,16 @@ class ReplaceHtmlLogic extends BaseLogic |
|
76
|
//查询当前类型所有装修的记录
|
75
|
//查询当前类型所有装修的记录
|
|
77
|
ProjectServer::useProject($this->param['project_id']);
|
76
|
ProjectServer::useProject($this->param['project_id']);
|
|
78
|
$bTemplateModel = new BTemplate();
|
77
|
$bTemplateModel = new BTemplate();
|
|
79
|
- $condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
|
78
|
+ $condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'],
|
|
|
|
79
|
+ 'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id,'main_html'=>['like','%'.$this->param['old_html'].'%']];
|
|
80
|
$list = $bTemplateModel->list($condition);
|
80
|
$list = $bTemplateModel->list($condition);
|
|
81
|
DB::disconnect('custom_mysql');
|
81
|
DB::disconnect('custom_mysql');
|
|
82
|
//TODO::生成一条任务记录
|
82
|
//TODO::生成一条任务记录
|
|
83
|
$total_num = count($list);
|
83
|
$total_num = count($list);
|
|
84
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
|
84
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
|
|
85
|
- foreach ($list as $v){
|
85
|
+ foreach ($list as $value){
|
|
86
|
//生成子任务
|
86
|
//生成子任务
|
|
87
|
- $this->saveReplaceHtmlLog($replaceId,$v);
|
87
|
+ $this->saveReplaceHtmlLog($replaceId,$value);
|
|
88
|
}
|
88
|
}
|
|
89
|
return $this->success();
|
89
|
return $this->success();
|
|
90
|
}
|
90
|
}
|
|
@@ -102,7 +102,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -102,7 +102,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
102
|
'is_custom'=>$typeInfo['is_custom'],
|
102
|
'is_custom'=>$typeInfo['is_custom'],
|
|
103
|
'is_list'=>$typeInfo['is_list'],
|
103
|
'is_list'=>$typeInfo['is_list'],
|
|
104
|
'template_id'=>$template_id,
|
104
|
'template_id'=>$template_id,
|
|
105
|
- 'status'=>BTemplate::STATUS,
|
105
|
+ 'status'=>$this->model::STATUS,
|
|
106
|
'old_html'=>$param['old_html'],
|
106
|
'old_html'=>$param['old_html'],
|
|
107
|
'html'=>$param['html'],
|
107
|
'html'=>$param['html'],
|
|
108
|
'project_id'=>$param['project_id'],
|
108
|
'project_id'=>$param['project_id'],
|
|
@@ -118,11 +118,19 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -118,11 +118,19 @@ class ReplaceHtmlLogic extends BaseLogic |
|
118
|
* @method :post
|
118
|
* @method :post
|
|
119
|
* @time :2024/5/8 9:37
|
119
|
* @time :2024/5/8 9:37
|
|
120
|
*/
|
120
|
*/
|
|
121
|
- public function saveReplaceHtmlLog($replace_id,$replace_template_id,$typeInfo){
|
121
|
+ public function saveReplaceHtmlLog($param,$replace_id,$data){
|
|
122
|
$logData = [
|
122
|
$logData = [
|
|
123
|
'replace_id'=>$replace_id,
|
123
|
'replace_id'=>$replace_id,
|
|
124
|
- 'source'=>$replace_template_id,
|
124
|
+ 'source'=>$data['source'],
|
|
|
|
125
|
+ 'source_id'=>$data['source_id'],
|
|
|
|
126
|
+ 'is_list'=>$data['is_list'],
|
|
|
|
127
|
+ 'is_custom'=>$data['is_custom'],
|
|
|
|
128
|
+ 'project_id'=>$data['project_id'],
|
|
125
|
'uid'=>$this->user['manager_id'],
|
129
|
'uid'=>$this->user['manager_id'],
|
|
|
|
130
|
+ 'status'=>$this->model::STATUS,
|
|
|
|
131
|
+ 'old_html'=>$param['old_html'],
|
|
|
|
132
|
+ 'html'=>$param['html'],
|
|
|
|
133
|
+ 'template_id'=>$data['template_id']
|
|
126
|
];
|
134
|
];
|
|
127
|
$replaceHtmlModel = new TemplateReplaceHtmlLog();
|
135
|
$replaceHtmlModel = new TemplateReplaceHtmlLog();
|
|
128
|
$save_id = $replaceHtmlModel->addReturnId($logData);
|
136
|
$save_id = $replaceHtmlModel->addReturnId($logData);
|