|
@@ -47,16 +47,21 @@ class ReplaceHtmlLog extends Command |
|
@@ -47,16 +47,21 @@ class ReplaceHtmlLog extends Command |
|
47
|
*/
|
47
|
*/
|
|
48
|
public function handle()
|
48
|
public function handle()
|
|
49
|
{
|
49
|
{
|
|
|
|
50
|
+ $replaceHtmlModel = new TemplateReplaceHtml();
|
|
|
|
51
|
+ $replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS_START]);
|
|
|
|
52
|
+ foreach ($replaceHtmlList as $value){
|
|
|
|
53
|
+ echo '开始主任务id:'.$value['id'].PHP_EOL;
|
|
50
|
$replaceHtmlLogModel = new TemplateReplaceHtmlLog();
|
54
|
$replaceHtmlLogModel = new TemplateReplaceHtmlLog();
|
|
51
|
- $replaceHtmlList = $replaceHtmlLogModel->list(['status'=>$replaceHtmlLogModel::STATUS]);
|
|
|
|
52
|
- foreach ($replaceHtmlList as $k => $v){
|
|
|
|
53
|
- ProjectServer::useProject($v['project_id']);
|
|
|
|
54
|
- echo '开始,任务id:'.$v['id'].PHP_EOL;
|
55
|
+ $replaceHtmlLogList = $replaceHtmlLogModel->list(['replace_id'=>$value['id'],'status'=>$replaceHtmlLogModel::STATUS]);
|
|
|
|
56
|
+ ProjectServer::useProject($value['project_id']);
|
|
|
|
57
|
+ foreach ($replaceHtmlLogList as $v){
|
|
55
|
$this->replaceHtml($v);
|
58
|
$this->replaceHtml($v);
|
|
56
|
- //修改当前主任务状态为待执行
|
|
|
|
57
|
$replaceHtmlLogModel->edit(['status'=>$replaceHtmlLogModel::STATUS_END],['id'=>$v['id']]);
|
59
|
$replaceHtmlLogModel->edit(['status'=>$replaceHtmlLogModel::STATUS_END],['id'=>$v['id']]);
|
|
58
|
- echo '结束'.PHP_EOL;
|
60
|
+ }
|
|
59
|
DB::disconnect('custom_mysql');
|
61
|
DB::disconnect('custom_mysql');
|
|
|
|
62
|
+ //修改当前主任务状态为待执行
|
|
|
|
63
|
+ $replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_END],['id'=>$value['id']]);
|
|
|
|
64
|
+ echo '结束'.PHP_EOL;
|
|
60
|
}
|
65
|
}
|
|
61
|
return true;
|
66
|
return true;
|
|
62
|
}
|
67
|
}
|
|
@@ -79,5 +84,6 @@ class ReplaceHtmlLog extends Command |
|
@@ -79,5 +84,6 @@ class ReplaceHtmlLog extends Command |
|
79
|
}else{
|
84
|
}else{
|
|
80
|
$bTemplateModel->formatQuery($condition)->update(['main_html' => DB::raw("REPLACE(main_html, '$old_html', '$html')")]);
|
85
|
$bTemplateModel->formatQuery($condition)->update(['main_html' => DB::raw("REPLACE(main_html, '$old_html', '$html')")]);
|
|
81
|
}
|
86
|
}
|
|
|
|
87
|
+ return true;
|
|
82
|
}
|
88
|
}
|
|
83
|
} |
89
|
} |