作者 lyh

gx

... ... @@ -90,6 +90,7 @@ class Count extends Command
}
}catch (\Exception $e){
echo date('Y-m-d H:i:s') . ' error: ' . '->' . $e->getMessage() . PHP_EOL;
Log::channel('day_count')->error('day_count:失败 ' . $e->getMessage());
}
echo date('Y-m-d H:i:s') . ' end: ' . PHP_EOL;
echo $this->error;
... ...
... ... @@ -10,6 +10,7 @@ use App\Services\ProjectServer;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class InquiryMonthlyCount extends Command
{
... ... @@ -70,7 +71,11 @@ class InquiryMonthlyCount extends Command
$arr['project_id'] = $value['project_id'];
// 获取当前日期时间
$arr['month'] = Carbon::now()->subMonth()->format('Y-m');
DB::table('gl_month_count')->insert($arr);
try {
DB::table('gl_month_count')->insert($arr);
}catch (\Exception $e){
Log::channel('month_count')->error('day_count:失败 ' . $e->getMessage());
}
}
return true;
}
... ...
... ... @@ -154,7 +154,7 @@ class KeywordLogic extends BaseLogic
}
}
}catch (\Exception $e){
return false;
$this->fail('保存失败,请联系管理员');
}
Common::del_user_cache('product_keyword',$this->user['project_id']);
NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);
... ...
... ... @@ -78,6 +78,18 @@ return [
'via' => \App\Factory\LogFormatterFactory::class,
'prefix' => 'test',
],
//日记录日志
'day_count' => [
'driver' => 'custom',
'via' => \App\Factory\LogFormatterFactory::class,
'prefix' => 'day_count',
],
//月记录日志
'month_count' => [
'driver' => 'custom',
'via' => \App\Factory\LogFormatterFactory::class,
'prefix' => 'month_count',
],
'wechatside' => [
'driver' => 'custom',
'via' => \App\Factory\LogFormatterFactory::class,
... ...