作者 lyh

gx

... ... @@ -40,7 +40,7 @@ class DeleteProductCategory extends Command
*
* @var string
*/
protected $description = '删除产品关键字';
protected $description = '删除产品分类';
/**
* Create a new command instance.
... ...
... ... @@ -62,22 +62,23 @@ class ReplaceHtml extends Command
while (true){
$replaceHtmlModel = new TemplateReplaceHtml();
$replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]);
if(!empty($replaceHtmlList)){
foreach ($replaceHtmlList as $v){
ProjectServer::useProject($v['project_id']);
echo '开始,任务id:'.$v['id'].PHP_EOL;
if($v['source'] == 9){//单页面
$count = $this->createReplacePageHtmlLog($v);
}else{
$count = $this->createReplaceHtmlLog($v);
}
//修改当前主任务状态为待执行
$replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_START,'total_num'=>$count],['id'=>$v['id']]);
echo '结束'.PHP_EOL;
DB::disconnect('custom_mysql');
if(empty($replaceHtmlList)){
sleep(100);
return true;
}
foreach ($replaceHtmlList as $v){
ProjectServer::useProject($v['project_id']);
echo '开始,任务id:'.$v['id'].PHP_EOL;
if($v['source'] == 9){//单页面
$count = $this->createReplacePageHtmlLog($v);
}else{
$count = $this->createReplaceHtmlLog($v);
}
//修改当前主任务状态为待执行
$replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_START,'total_num'=>$count],['id'=>$v['id']]);
echo '结束'.PHP_EOL;
DB::disconnect('custom_mysql');
}
sleep(5);
return true;
}
}
... ...