作者 lyh

gx

@@ -40,7 +40,7 @@ class DeleteProductCategory extends Command @@ -40,7 +40,7 @@ class DeleteProductCategory extends Command
40 * 40 *
41 * @var string 41 * @var string
42 */ 42 */
43 - protected $description = '删除产品关键字'; 43 + protected $description = '删除产品分类';
44 44
45 /** 45 /**
46 * Create a new command instance. 46 * Create a new command instance.
@@ -62,22 +62,23 @@ class ReplaceHtml extends Command @@ -62,22 +62,23 @@ class ReplaceHtml extends Command
62 while (true){ 62 while (true){
63 $replaceHtmlModel = new TemplateReplaceHtml(); 63 $replaceHtmlModel = new TemplateReplaceHtml();
64 $replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]); 64 $replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]);
65 - if(!empty($replaceHtmlList)){  
66 - foreach ($replaceHtmlList as $v){  
67 - ProjectServer::useProject($v['project_id']);  
68 - echo '开始,任务id:'.$v['id'].PHP_EOL;  
69 - if($v['source'] == 9){//单页面  
70 - $count = $this->createReplacePageHtmlLog($v);  
71 - }else{  
72 - $count = $this->createReplaceHtmlLog($v);  
73 - }  
74 - //修改当前主任务状态为待执行  
75 - $replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_START,'total_num'=>$count],['id'=>$v['id']]);  
76 - echo '结束'.PHP_EOL;  
77 - DB::disconnect('custom_mysql'); 65 + if(empty($replaceHtmlList)){
  66 + sleep(100);
  67 + return true;
  68 + }
  69 + foreach ($replaceHtmlList as $v){
  70 + ProjectServer::useProject($v['project_id']);
  71 + echo '开始,任务id:'.$v['id'].PHP_EOL;
  72 + if($v['source'] == 9){//单页面
  73 + $count = $this->createReplacePageHtmlLog($v);
  74 + }else{
  75 + $count = $this->createReplaceHtmlLog($v);
78 } 76 }
  77 + //修改当前主任务状态为待执行
  78 + $replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_START,'total_num'=>$count],['id'=>$v['id']]);
  79 + echo '结束'.PHP_EOL;
  80 + DB::disconnect('custom_mysql');
79 } 81 }
80 - sleep(5);  
81 return true; 82 return true;
82 } 83 }
83 } 84 }