|
@@ -66,7 +66,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -66,7 +66,7 @@ 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
|
- ProjectServer::useProject($this->param['project_id']);
|
69
|
+
|
|
70
|
$data = $this->sourceTypeInfo();
|
70
|
$data = $this->sourceTypeInfo();
|
|
71
|
$typeInfo = $data[$this->param['name']];
|
71
|
$typeInfo = $data[$this->param['name']];
|
|
72
|
if(!isset($typeInfo)){
|
72
|
if(!isset($typeInfo)){
|
|
@@ -76,8 +76,9 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -76,8 +76,9 @@ class ReplaceHtmlLogic extends BaseLogic |
|
76
|
//TODO::生成一条任务记录
|
76
|
//TODO::生成一条任务记录
|
|
77
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);
|
77
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);
|
|
78
|
//查询当前类型所有装修的记录
|
78
|
//查询当前类型所有装修的记录
|
|
|
|
79
|
+ $bTemplateModel = new BTemplate();
|
|
79
|
$condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
|
80
|
$condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
|
|
80
|
- $list = $this->model->list($condition);
|
81
|
+ $list = $bTemplateModel->list($condition);
|
|
81
|
foreach ($list as $v){
|
82
|
foreach ($list as $v){
|
|
82
|
if($v['type'] == 0){
|
83
|
if($v['type'] == 0){
|
|
83
|
$main_html = str_replace($this->param['old_html'],$this->param['html'],$v['main_html']);
|
84
|
$main_html = str_replace($this->param['old_html'],$this->param['html'],$v['main_html']);
|
|
@@ -88,7 +89,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -88,7 +89,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
88
|
}
|
89
|
}
|
|
89
|
$this->saveReplaceHtmlLog($replaceId,$v['id']);
|
90
|
$this->saveReplaceHtmlLog($replaceId,$v['id']);
|
|
90
|
}
|
91
|
}
|
|
91
|
- DB::disconnect('custom_mysql');
|
|
|
|
92
|
return $this->success();
|
92
|
return $this->success();
|
|
93
|
}
|
93
|
}
|
|
94
|
|
94
|
|
|
@@ -120,13 +120,16 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -120,13 +120,16 @@ class ReplaceHtmlLogic extends BaseLogic |
|
120
|
* @time :2024/5/8 9:37
|
120
|
* @time :2024/5/8 9:37
|
|
121
|
*/
|
121
|
*/
|
|
122
|
public function saveReplaceHtmlLog($replace_id,$replace_template_id){
|
122
|
public function saveReplaceHtmlLog($replace_id,$replace_template_id){
|
|
|
|
123
|
+ ProjectServer::useProject($this->param['project_id']);
|
|
123
|
$logData = [
|
124
|
$logData = [
|
|
124
|
'replace_id'=>$replace_id,
|
125
|
'replace_id'=>$replace_id,
|
|
125
|
'replace_template_id'=>$replace_template_id,
|
126
|
'replace_template_id'=>$replace_template_id,
|
|
126
|
'uid'=>$this->user['manager_id'],
|
127
|
'uid'=>$this->user['manager_id'],
|
|
127
|
];
|
128
|
];
|
|
128
|
$replaceHtmlModel = new TemplateReplaceHtmlLog();
|
129
|
$replaceHtmlModel = new TemplateReplaceHtmlLog();
|
|
129
|
- return $replaceHtmlModel->add($logData);
|
130
|
+ $save_id = $replaceHtmlModel->addReturnId($logData);
|
|
|
|
131
|
+ DB::disconnect('custom_mysql');
|
|
|
|
132
|
+ return $this->success($save_id);
|
|
130
|
}
|
133
|
}
|
|
131
|
|
134
|
|
|
132
|
/**
|
135
|
/**
|
|
@@ -137,12 +140,12 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -137,12 +140,12 @@ class ReplaceHtmlLogic extends BaseLogic |
|
137
|
* @time :2024/5/8 10:35
|
140
|
* @time :2024/5/8 10:35
|
|
138
|
*/
|
141
|
*/
|
|
139
|
public function reductionHtml(){
|
142
|
public function reductionHtml(){
|
|
140
|
- ProjectServer::useProject($this->param['project_id']);
|
|
|
|
141
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
143
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
142
|
if($info === false){
|
144
|
if($info === false){
|
|
143
|
$this->fail('当前数据不存在');
|
145
|
$this->fail('当前数据不存在');
|
|
144
|
}
|
146
|
}
|
|
145
|
$replaceId = $this->saveResultReplaceHtml($info);
|
147
|
$replaceId = $this->saveResultReplaceHtml($info);
|
|
|
|
148
|
+ ProjectServer::useProject($this->param['project_id']);
|
|
146
|
$replaceLogModel = new TemplateReplaceHtmlLog();
|
149
|
$replaceLogModel = new TemplateReplaceHtmlLog();
|
|
147
|
$logList = $replaceLogModel->list(['replace_id'=>$this->param['id']]);
|
150
|
$logList = $replaceLogModel->list(['replace_id'=>$this->param['id']]);
|
|
148
|
$replaceArr = [];
|
151
|
$replaceArr = [];
|