postData = $postData; } /** * Execute the console command. * * @return mixed */ public function handle() { $this->line("开始统计昨日内容"); $postData = $this->postData ->where('created_at', '>=', Carbon::now()->startOfDay()->toDateTimeString()) ->select(DB::raw('count(*) as count'), DB::raw('sum(create_bean) as bean')) ->first(); Log::info('统计昨日内容'.json_encode($postData)); Log::debug('统计昨日内容'.json_encode($postData)); Redis::set('yesterday_post_count', $postData->count); Redis::set('yesterday_post_create_bean', $postData->bean); $this->line("统计昨日内容结束"); } }