|
...
|
...
|
@@ -66,7 +66,6 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
* @time :2024/5/7 15:52
|
|
|
|
*/
|
|
|
|
public function replaceTemplateMainHtml(){
|
|
|
|
|
|
|
|
$data = $this->sourceTypeInfo();
|
|
|
|
$typeInfo = $data[$this->param['name']];
|
|
|
|
if(!isset($typeInfo)){
|
|
...
|
...
|
@@ -76,15 +75,16 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
//查询当前类型所有装修的记录
|
|
|
|
ProjectServer::useProject($this->param['project_id']);
|
|
|
|
$bTemplateModel = new BTemplate();
|
|
|
|
$condition = ['source'=>$typeInfo['source'],'is_custom'=>$typeInfo['is_custom'],'is_list'=>$typeInfo['is_list'], 'template_id'=>$template_id];
|
|
|
|
$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'].'%']];
|
|
|
|
$list = $bTemplateModel->list($condition);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
//TODO::生成一条任务记录
|
|
|
|
$total_num = count($list);
|
|
|
|
$replaceId = $this->saveReplaceHtml($this->param,$typeInfo,$template_id,$total_num);
|
|
|
|
foreach ($list as $v){
|
|
|
|
foreach ($list as $value){
|
|
|
|
//生成子任务
|
|
|
|
$this->saveReplaceHtmlLog($replaceId,$v);
|
|
|
|
$this->saveReplaceHtmlLog($replaceId,$value);
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
...
|
...
|
@@ -102,7 +102,7 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
'is_custom'=>$typeInfo['is_custom'],
|
|
|
|
'is_list'=>$typeInfo['is_list'],
|
|
|
|
'template_id'=>$template_id,
|
|
|
|
'status'=>BTemplate::STATUS,
|
|
|
|
'status'=>$this->model::STATUS,
|
|
|
|
'old_html'=>$param['old_html'],
|
|
|
|
'html'=>$param['html'],
|
|
|
|
'project_id'=>$param['project_id'],
|
|
...
|
...
|
@@ -118,11 +118,19 @@ class ReplaceHtmlLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2024/5/8 9:37
|
|
|
|
*/
|
|
|
|
public function saveReplaceHtmlLog($replace_id,$replace_template_id,$typeInfo){
|
|
|
|
public function saveReplaceHtmlLog($param,$replace_id,$data){
|
|
|
|
$logData = [
|
|
|
|
'replace_id'=>$replace_id,
|
|
|
|
'source'=>$replace_template_id,
|
|
|
|
'source'=>$data['source'],
|
|
|
|
'source_id'=>$data['source_id'],
|
|
|
|
'is_list'=>$data['is_list'],
|
|
|
|
'is_custom'=>$data['is_custom'],
|
|
|
|
'project_id'=>$data['project_id'],
|
|
|
|
'uid'=>$this->user['manager_id'],
|
|
|
|
'status'=>$this->model::STATUS,
|
|
|
|
'old_html'=>$param['old_html'],
|
|
|
|
'html'=>$param['html'],
|
|
|
|
'template_id'=>$data['template_id']
|
|
|
|
];
|
|
|
|
$replaceHtmlModel = new TemplateReplaceHtmlLog();
|
|
|
|
$save_id = $replaceHtmlModel->addReturnId($logData);
|
...
|
...
|
|