postData = $postData; } /** * Execute the console command. * * @return mixed */ public function handle() { $this->line("开始更新内容生成U米"); $key = 'post_create_bean'; $ids = Redis::ZRANGE($key, 0 , -1, 'WITHSCORES'); foreach($ids as $postId => $val){ try{ $value = Redis::ZSCORE($key, $postId); Redis::ZREM ($key, $postId); $this->postData->where('post_id', $postId)->increment('create_bean', $value); Log::debug('更新内容生成U米成功'.$postId.'-'.$value); }catch (\Exception $exception){ Log::error('更新内容生成U米失败'.$postId.'-'.$val.$exception->getMessage()); } usleep(10000); } $this->line("更新内容生成U米结束"); } }