作者 lyh

gx

@@ -90,6 +90,7 @@ class Count extends Command @@ -90,6 +90,7 @@ class Count extends Command
90 } 90 }
91 }catch (\Exception $e){ 91 }catch (\Exception $e){
92 echo date('Y-m-d H:i:s') . ' error: ' . '->' . $e->getMessage() . PHP_EOL; 92 echo date('Y-m-d H:i:s') . ' error: ' . '->' . $e->getMessage() . PHP_EOL;
  93 + Log::channel('day_count')->error('day_count:失败 ' . $e->getMessage());
93 } 94 }
94 echo date('Y-m-d H:i:s') . ' end: ' . PHP_EOL; 95 echo date('Y-m-d H:i:s') . ' end: ' . PHP_EOL;
95 echo $this->error; 96 echo $this->error;
@@ -10,6 +10,7 @@ use App\Services\ProjectServer; @@ -10,6 +10,7 @@ use App\Services\ProjectServer;
10 use Carbon\Carbon; 10 use Carbon\Carbon;
11 use Illuminate\Console\Command; 11 use Illuminate\Console\Command;
12 use Illuminate\Support\Facades\DB; 12 use Illuminate\Support\Facades\DB;
  13 +use Illuminate\Support\Facades\Log;
13 14
14 class InquiryMonthlyCount extends Command 15 class InquiryMonthlyCount extends Command
15 { 16 {
@@ -70,7 +71,11 @@ class InquiryMonthlyCount extends Command @@ -70,7 +71,11 @@ class InquiryMonthlyCount extends Command
70 $arr['project_id'] = $value['project_id']; 71 $arr['project_id'] = $value['project_id'];
71 // 获取当前日期时间 72 // 获取当前日期时间
72 $arr['month'] = Carbon::now()->subMonth()->format('Y-m'); 73 $arr['month'] = Carbon::now()->subMonth()->format('Y-m');
73 - DB::table('gl_month_count')->insert($arr); 74 + try {
  75 + DB::table('gl_month_count')->insert($arr);
  76 + }catch (\Exception $e){
  77 + Log::channel('month_count')->error('day_count:失败 ' . $e->getMessage());
  78 + }
74 } 79 }
75 return true; 80 return true;
76 } 81 }
@@ -154,7 +154,7 @@ class KeywordLogic extends BaseLogic @@ -154,7 +154,7 @@ class KeywordLogic extends BaseLogic
154 } 154 }
155 } 155 }
156 }catch (\Exception $e){ 156 }catch (\Exception $e){
157 - return false; 157 + $this->fail('保存失败,请联系管理员');
158 } 158 }
159 Common::del_user_cache('product_keyword',$this->user['project_id']); 159 Common::del_user_cache('product_keyword',$this->user['project_id']);
160 NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]); 160 NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);
@@ -78,6 +78,18 @@ return [ @@ -78,6 +78,18 @@ return [
78 'via' => \App\Factory\LogFormatterFactory::class, 78 'via' => \App\Factory\LogFormatterFactory::class,
79 'prefix' => 'test', 79 'prefix' => 'test',
80 ], 80 ],
  81 + //日记录日志
  82 + 'day_count' => [
  83 + 'driver' => 'custom',
  84 + 'via' => \App\Factory\LogFormatterFactory::class,
  85 + 'prefix' => 'day_count',
  86 + ],
  87 + //月记录日志
  88 + 'month_count' => [
  89 + 'driver' => 'custom',
  90 + 'via' => \App\Factory\LogFormatterFactory::class,
  91 + 'prefix' => 'month_count',
  92 + ],
81 'wechatside' => [ 93 'wechatside' => [
82 'driver' => 'custom', 94 'driver' => 'custom',
83 'via' => \App\Factory\LogFormatterFactory::class, 95 'via' => \App\Factory\LogFormatterFactory::class,