作者 lyh

gx

@@ -67,7 +67,7 @@ class DeleteProductCategory extends Command @@ -67,7 +67,7 @@ class DeleteProductCategory extends Command
67 } 67 }
68 foreach ($list as $item){ 68 foreach ($list as $item){
69 echo 'start:' . $item['id'] . PHP_EOL; 69 echo 'start:' . $item['id'] . PHP_EOL;
70 -// try { 70 + try {
71 $projectModel = new Project(); 71 $projectModel = new Project();
72 $projectInfo = $projectModel->read(['id'=>$item['data']['project_id']]); 72 $projectInfo = $projectModel->read(['id'=>$item['data']['project_id']]);
73 if($projectInfo === false){ 73 if($projectInfo === false){
@@ -78,10 +78,10 @@ class DeleteProductCategory extends Command @@ -78,10 +78,10 @@ class DeleteProductCategory extends Command
78 DB::disconnect('custom_mysql'); 78 DB::disconnect('custom_mysql');
79 $noticeLogModel->edit(['status'=>NoticeLog::STATUS_SUCCESS],['id'=>$item['id']]); 79 $noticeLogModel->edit(['status'=>NoticeLog::STATUS_SUCCESS],['id'=>$item['id']]);
80 echo 'success:' . $item['id'] . PHP_EOL; 80 echo 'success:' . $item['id'] . PHP_EOL;
81 -// }catch (\Exception $e){  
82 -// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;  
83 -// errorLog('项目初始化失败', $item, $e);  
84 -// } 81 + }catch (\Exception $e){
  82 + echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
  83 + errorLog('项目初始化失败', $item, $e);
  84 + }
85 } 85 }
86 return true; 86 return true;
87 } 87 }
@@ -105,7 +105,6 @@ class DeleteProductCategory extends Command @@ -105,7 +105,6 @@ class DeleteProductCategory extends Command
105 foreach ($productList['list'] as $v){ 105 foreach ($productList['list'] as $v){
106 $categoryRelatedModel = new CategoryRelated(); 106 $categoryRelatedModel = new CategoryRelated();
107 if(empty($v['category_id'])){ 107 if(empty($v['category_id'])){
108 - echo json_encode($v);  
109 $categoryRelatedModel->del(['product_id'=>$v['id']]); 108 $categoryRelatedModel->del(['product_id'=>$v['id']]);
110 continue; 109 continue;
111 } 110 }