|
...
|
...
|
@@ -66,7 +66,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
* @time :2024/5/7 15:52
|
|
|
|
*/
|
|
|
|
public function replaceTemplateMainHtml(){
|
|
|
|
ProjectServer::useProject($this->param['project_id']);
|
|
|
|
|
|
|
|
$data = $this->sourceTypeInfo();
|
|
|
|
$typeInfo = $data[$this->param['name']];
|
|
|
|
if(!isset($typeInfo)){
|
|
...
|
...
|
@@ -76,8 +76,9 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
//TODO::生成一条任务记录
|
|
|
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id);
|
|
|
|
//查询当前类型所有装修的记录
|
|
|
|
$bTemplateModel = new BTemplate();
|
|
|
|
$condition = ['source'=>$typeInfo['type'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
|
|
|
|
$list = $this->model->list($condition);
|
|
|
|
$list = $bTemplateModel->list($condition);
|
|
|
|
foreach ($list as $v){
|
|
|
|
if($v['type'] == 0){
|
|
|
|
$main_html = str_replace($this->param['old_html'],$this->param['html'],$v['main_html']);
|
|
...
|
...
|
@@ -88,7 +89,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$this->saveReplaceHtmlLog($replaceId,$v['id']);
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -120,13 +120,16 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
* @time :2024/5/8 9:37
|
|
|
|
*/
|
|
|
|
public function saveReplaceHtmlLog($replace_id,$replace_template_id){
|
|
|
|
ProjectServer::useProject($this->param['project_id']);
|
|
|
|
$logData = [
|
|
|
|
'replace_id'=>$replace_id,
|
|
|
|
'replace_template_id'=>$replace_template_id,
|
|
|
|
'uid'=>$this->user['manager_id'],
|
|
|
|
];
|
|
|
|
$replaceHtmlModel = new TemplateReplaceHtmlLog();
|
|
|
|
return $replaceHtmlModel->add($logData);
|
|
|
|
$save_id = $replaceHtmlModel->addReturnId($logData);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return $this->success($save_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -137,12 +140,12 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
* @time :2024/5/8 10:35
|
|
|
|
*/
|
|
|
|
public function reductionHtml(){
|
|
|
|
ProjectServer::useProject($this->param['project_id']);
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在');
|
|
|
|
}
|
|
|
|
$replaceId = $this->saveResultReplaceHtml($info);
|
|
|
|
ProjectServer::useProject($this->param['project_id']);
|
|
|
|
$replaceLogModel = new TemplateReplaceHtmlLog();
|
|
|
|
$logList = $replaceLogModel->list(['replace_id'=>$this->param['id']]);
|
|
|
|
$replaceArr = [];
|
...
|
...
|
|