container = $container; parent::__construct($this->name); } public function handle() { $chunkSize = 100; CreatorModel::query()->where('day_video', '>', 0)->orderBy('id', 'ASC')->chunk($chunkSize, function ($items) { foreach ($items as $item) { $item->day_video = 0; $item->save(); } }); $nowDate = Carbon::now()->toDateTimeString(); logger('CreatorVideoDayInitCommand:完成每日清零创作者视频量'); $this->comment(sprintf('[%s]完成每日清零创作者视频量', $nowDate)); } }