作者 lyh

gx

@@ -85,16 +85,14 @@ class Count extends Command @@ -85,16 +85,14 @@ class Count extends Command
85 if($arr === false){ 85 if($arr === false){
86 $data[] = $v['test_domain']; 86 $data[] = $v['test_domain'];
87 } 87 }
88 - //判断数据是否存在  
89 DB::table('gl_count')->insert($arr); 88 DB::table('gl_count')->insert($arr);
  89 + Log::channel('day_count')->error('日期:'.$arr['created_at'].'success: ' .$v['test_domain']);
90 } 90 }
91 } 91 }
92 }catch (\Exception $e){ 92 }catch (\Exception $e){
93 - echo date('Y-m-d H:i:s') . ' error: ' . '->' . $e->getMessage() . PHP_EOL;  
94 - Log::channel('day_count')->error('day_count:失败 ' . $e->getMessage()); 93 + Log::channel('day_count')->error('day_count:->error ' . $e->getMessage());
95 } 94 }
96 - Log::channel('day_count')->error('day_count:失败的域名 ' .json_encode($data));  
97 - echo date('Y-m-d H:i:s') . ' end: ' . PHP_EOL; 95 + Log::channel('day_count')->error('success:end');
98 echo $this->error; 96 echo $this->error;
99 } 97 }
100 98
@@ -6,6 +6,7 @@ use App\Models\Inquiry\InquiryCount as InquiryCountModel; @@ -6,6 +6,7 @@ use App\Models\Inquiry\InquiryCount as InquiryCountModel;
6 use App\Models\Inquiry\InquiryInfo; 6 use App\Models\Inquiry\InquiryInfo;
7 use Carbon\Carbon; 7 use Carbon\Carbon;
8 use Illuminate\Console\Command; 8 use Illuminate\Console\Command;
  9 +use Illuminate\Support\Facades\Log;
9 10
10 /** 11 /**
11 * @remark : 12 * @remark :
@@ -62,6 +63,7 @@ class InquiryCount extends Command @@ -62,6 +63,7 @@ class InquiryCount extends Command
62 //获取昨天的时间 63 //获取昨天的时间
63 $yesterday = Carbon::yesterday()->toDateString(); 64 $yesterday = Carbon::yesterday()->toDateString();
64 $inquiryInfoModel = new InquiryInfo(); 65 $inquiryInfoModel = new InquiryInfo();
  66 + try {
65 foreach ($this->status as $k=>$v){ 67 foreach ($this->status as $k=>$v){
66 $total = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']]])->count(); 68 $total = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']]])->count();
67 $untreated = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']],'status'=>1])->count(); 69 $untreated = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']],'status'=>1])->count();
@@ -76,6 +78,9 @@ class InquiryCount extends Command @@ -76,6 +78,9 @@ class InquiryCount extends Command
76 } 78 }
77 $inquiryCount = new InquiryCountModel(); 79 $inquiryCount = new InquiryCountModel();
78 $inquiryCount->insert($data); 80 $inquiryCount->insert($data);
  81 + }catch (\Exception $e){
  82 + Log::error('inquiry_count : error');
  83 + }
79 return true; 84 return true;
80 } 85 }
81 } 86 }
@@ -81,7 +81,7 @@ class DeleteBlogCategory extends Command @@ -81,7 +81,7 @@ class DeleteBlogCategory extends Command
81 echo 'success:' . $item['id'] . PHP_EOL; 81 echo 'success:' . $item['id'] . PHP_EOL;
82 }catch (\Exception $e){ 82 }catch (\Exception $e){
83 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; 83 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
84 - errorLog('项目初始化失败', $item, $e); 84 + errorLog('delete_blog_category删除失败', $item, $e);
85 } 85 }
86 } 86 }
87 return true; 87 return true;
@@ -81,7 +81,7 @@ class DeleteCustomCategory extends Command @@ -81,7 +81,7 @@ class DeleteCustomCategory extends Command
81 echo 'success:' . $item['id'] . PHP_EOL; 81 echo 'success:' . $item['id'] . PHP_EOL;
82 }catch (\Exception $e){ 82 }catch (\Exception $e){
83 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; 83 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
84 - errorLog('项目初始化失败', $item, $e); 84 + errorLog('delete_custom_category删除失败', $item, $e);
85 } 85 }
86 } 86 }
87 return true; 87 return true;
@@ -68,7 +68,7 @@ class DeleteNewsCategory extends Command @@ -68,7 +68,7 @@ class DeleteNewsCategory extends Command
68 } 68 }
69 foreach ($list as $item){ 69 foreach ($list as $item){
70 echo 'start:' . $item['id'] . PHP_EOL; 70 echo 'start:' . $item['id'] . PHP_EOL;
71 -// try { 71 + try {
72 $projectModel = new Project(); 72 $projectModel = new Project();
73 $projectInfo = $projectModel->read(['id'=>$item['data']['project_id']]); 73 $projectInfo = $projectModel->read(['id'=>$item['data']['project_id']]);
74 if($projectInfo === false){ 74 if($projectInfo === false){
@@ -79,10 +79,10 @@ class DeleteNewsCategory extends Command @@ -79,10 +79,10 @@ class DeleteNewsCategory extends Command
79 DB::disconnect('custom_mysql'); 79 DB::disconnect('custom_mysql');
80 $noticeLogModel->edit(['status'=>NoticeLog::STATUS_SUCCESS],['id'=>$item['id']]); 80 $noticeLogModel->edit(['status'=>NoticeLog::STATUS_SUCCESS],['id'=>$item['id']]);
81 echo 'success:' . $item['id'] . PHP_EOL; 81 echo 'success:' . $item['id'] . PHP_EOL;
82 -// }catch (\Exception $e){  
83 -// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;  
84 -// errorLog('项目初始化失败', $item, $e);  
85 -// } 82 + }catch (\Exception $e){
  83 + echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
  84 + errorLog('delete_news_category删除失败', $item, $e);
  85 + }
86 } 86 }
87 return true; 87 return true;
88 } 88 }
@@ -82,7 +82,7 @@ class DeleteProductCategory extends Command @@ -82,7 +82,7 @@ class DeleteProductCategory extends Command
82 echo 'success:' . $item['id'] . PHP_EOL; 82 echo 'success:' . $item['id'] . PHP_EOL;
83 }catch (\Exception $e){ 83 }catch (\Exception $e){
84 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; 84 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
85 - errorLog('项目初始化失败', $item, $e); 85 + errorLog('delete_product_category删除失败', $item, $e);
86 } 86 }
87 } 87 }
88 return true; 88 return true;
@@ -72,7 +72,6 @@ class DomainInfo extends Command @@ -72,7 +72,6 @@ class DomainInfo extends Command
72 'domain_start_time' => $time['start'], 72 'domain_start_time' => $time['start'],
73 'domain_end_time' => $time['end'] 73 'domain_end_time' => $time['end']
74 ]; 74 ];
75 -  
76 $domainModel->edit($data, ['id' => $v['id']]); 75 $domainModel->edit($data, ['id' => $v['id']]);
77 } 76 }
78 } 77 }
@@ -47,8 +47,6 @@ class RemainDay extends Command @@ -47,8 +47,6 @@ class RemainDay extends Command
47 $list = Project::whereIn('type', [2,3,4])->get(); 47 $list = Project::whereIn('type', [2,3,4])->get();
48 foreach ($list as $item){ 48 foreach ($list as $item){
49 if($item['type'] == Project::TYPE_TWO){ 49 if($item['type'] == Project::TYPE_TWO){
50 - //排名达标天数  
51 -// $compliance_day = GoogleRankModel::where(['project_id' => $item['id'], 'lang' => ''])->value('compliance_day') ?: 0;  
52 //获取当前项目的达标天数 50 //获取当前项目的达标天数
53 $compliance_day = Project::where(['id' => $item['id']])->value('finish_remain_day') ?: 0; 51 $compliance_day = Project::where(['id' => $item['id']])->value('finish_remain_day') ?: 0;
54 $remain_day = $item['deploy_build']['service_duration'] - $compliance_day; 52 $remain_day = $item['deploy_build']['service_duration'] - $compliance_day;
@@ -62,6 +62,7 @@ class ServiceCount extends Command @@ -62,6 +62,7 @@ class ServiceCount extends Command
62 } 62 }
63 $model->edit(['count'=>$count],['id'=>$v['id']]); 63 $model->edit(['count'=>$count],['id'=>$v['id']]);
64 } 64 }
  65 + return true;
65 } 66 }
66 67
67 } 68 }
@@ -73,8 +73,9 @@ class InquiryMonthlyCount extends Command @@ -73,8 +73,9 @@ class InquiryMonthlyCount extends Command
73 $arr['month'] = Carbon::now()->subMonth()->format('Y-m'); 73 $arr['month'] = Carbon::now()->subMonth()->format('Y-m');
74 try { 74 try {
75 DB::table('gl_month_count')->insert($arr); 75 DB::table('gl_month_count')->insert($arr);
  76 + Log::channel('month_count')->error('success:project_id .'.$arr['project_id']);
76 }catch (\Exception $e){ 77 }catch (\Exception $e){
77 - Log::channel('month_count')->error('month_count:失败 ' . $e->getMessage()); 78 + Log::channel('month_count')->error('month_count:error ' . $e->getMessage());
78 } 79 }
79 } 80 }
80 return true; 81 return true;