|
...
|
...
|
@@ -126,7 +126,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
$data = $this->sourceTypeInfo($this->param['project_id']);
|
|
|
|
$typeInfo = $data[$this->param['name']];
|
|
|
|
ProjectServer::useProject($this->param['project_id']);
|
|
|
|
$bTemplateModel = new BTemplate();
|
|
|
|
if($typeInfo['source'] == 0){//所有页面
|
|
|
|
$bSettingModel = new Setting();
|
|
|
|
$templateInfo = $bSettingModel->read(['project_id'=>$this->param['project_id']]);
|
|
...
|
...
|
@@ -134,18 +133,11 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
$this->fail('请先选择模版');
|
|
|
|
}
|
|
|
|
$template_id = $templateInfo['template_id'];
|
|
|
|
$condition = ['template_id'=>$template_id,'main_html'=>['like','%'.$this->param['old_html'].'%']];
|
|
|
|
$total_num = $bTemplateModel->formatQuery($condition)->count();
|
|
|
|
|
|
|
|
}else{
|
|
|
|
$template_id = $this->getTemplateId($typeInfo);
|
|
|
|
$condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'], 'is_list'=>$typeInfo['is_list'],
|
|
|
|
'template_id'=>$template_id,'main_html'=>['like','%'.$this->param['old_html'].'%']];
|
|
|
|
$total_num = $bTemplateModel->formatQuery($condition)->count();
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($total_num, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num ?? 0);
|
|
|
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);
|
|
|
|
return $this->success(['id'=>$replaceId]);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -156,7 +148,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2024/5/8 9:23
|
|
|
|
*/
|
|
|
|
public function saveReplaceHtml($param,$typeInfo,$template_id,$total_num){
|
|
|
|
public function saveReplaceHtml($param,$typeInfo,$template_id){
|
|
|
|
$logData = [
|
|
|
|
'source'=>$typeInfo['source'],
|
|
|
|
'is_custom'=>$typeInfo['is_custom'],
|
|
...
|
...
|
@@ -166,7 +158,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
'old_html'=>$param['old_html'],
|
|
|
|
'html'=>$param['html'],
|
|
|
|
'project_id'=>$param['project_id'],
|
|
|
|
'total_num'=>$total_num,
|
|
|
|
'total_num'=>0,
|
|
|
|
'operator_id'=>$this->manager['id']
|
|
|
|
];
|
|
|
|
return $this->model->addReturnId($logData);
|
...
|
...
|
|