|
@@ -126,7 +126,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -126,7 +126,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
126
|
$data = $this->sourceTypeInfo($this->param['project_id']);
|
126
|
$data = $this->sourceTypeInfo($this->param['project_id']);
|
|
127
|
$typeInfo = $data[$this->param['name']];
|
127
|
$typeInfo = $data[$this->param['name']];
|
|
128
|
ProjectServer::useProject($this->param['project_id']);
|
128
|
ProjectServer::useProject($this->param['project_id']);
|
|
129
|
- $bTemplateModel = new BTemplate();
|
|
|
|
130
|
if($typeInfo['source'] == 0){//所有页面
|
129
|
if($typeInfo['source'] == 0){//所有页面
|
|
131
|
$bSettingModel = new Setting();
|
130
|
$bSettingModel = new Setting();
|
|
132
|
$templateInfo = $bSettingModel->read(['project_id'=>$this->param['project_id']]);
|
131
|
$templateInfo = $bSettingModel->read(['project_id'=>$this->param['project_id']]);
|
|
@@ -134,18 +133,11 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -134,18 +133,11 @@ class ReplaceHtmlLogic extends BaseLogic |
|
134
|
$this->fail('请先选择模版');
|
133
|
$this->fail('请先选择模版');
|
|
135
|
}
|
134
|
}
|
|
136
|
$template_id = $templateInfo['template_id'];
|
135
|
$template_id = $templateInfo['template_id'];
|
|
137
|
- $condition = ['template_id'=>$template_id,'main_html'=>['like','%'.$this->param['old_html'].'%']];
|
|
|
|
138
|
- $total_num = $bTemplateModel->formatQuery($condition)->count();
|
|
|
|
139
|
-
|
|
|
|
140
|
}else{
|
136
|
}else{
|
|
141
|
$template_id = $this->getTemplateId($typeInfo);
|
137
|
$template_id = $this->getTemplateId($typeInfo);
|
|
142
|
- $condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'], 'is_list'=>$typeInfo['is_list'],
|
|
|
|
143
|
- 'template_id'=>$template_id,'main_html'=>['like','%'.$this->param['old_html'].'%']];
|
|
|
|
144
|
- $total_num = $bTemplateModel->formatQuery($condition)->count();
|
|
|
|
145
|
- @file_put_contents(storage_path('logs/lyh_error.log'), var_export($total_num, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
146
|
}
|
138
|
}
|
|
147
|
DB::disconnect('custom_mysql');
|
139
|
DB::disconnect('custom_mysql');
|
|
148
|
- $replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num ?? 0);
|
140
|
+ $replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);
|
|
149
|
return $this->success(['id'=>$replaceId]);
|
141
|
return $this->success(['id'=>$replaceId]);
|
|
150
|
}
|
142
|
}
|
|
151
|
|
143
|
|
|
@@ -156,7 +148,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -156,7 +148,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
156
|
* @method :post
|
148
|
* @method :post
|
|
157
|
* @time :2024/5/8 9:23
|
149
|
* @time :2024/5/8 9:23
|
|
158
|
*/
|
150
|
*/
|
|
159
|
- public function saveReplaceHtml($param,$typeInfo,$template_id,$total_num){
|
151
|
+ public function saveReplaceHtml($param,$typeInfo,$template_id){
|
|
160
|
$logData = [
|
152
|
$logData = [
|
|
161
|
'source'=>$typeInfo['source'],
|
153
|
'source'=>$typeInfo['source'],
|
|
162
|
'is_custom'=>$typeInfo['is_custom'],
|
154
|
'is_custom'=>$typeInfo['is_custom'],
|
|
@@ -166,7 +158,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
@@ -166,7 +158,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
166
|
'old_html'=>$param['old_html'],
|
158
|
'old_html'=>$param['old_html'],
|
|
167
|
'html'=>$param['html'],
|
159
|
'html'=>$param['html'],
|
|
168
|
'project_id'=>$param['project_id'],
|
160
|
'project_id'=>$param['project_id'],
|
|
169
|
- 'total_num'=>$total_num,
|
161
|
+ 'total_num'=>0,
|
|
170
|
'operator_id'=>$this->manager['id']
|
162
|
'operator_id'=>$this->manager['id']
|
|
171
|
];
|
163
|
];
|
|
172
|
return $this->model->addReturnId($logData);
|
164
|
return $this->model->addReturnId($logData);
|