where('slug',Statistic::SLUG_PROFIT_STATIC)->whereIn('area_id',[9999,9]) ->where('date','>',Carbon::today()->subDays(30))->get(); $bikes = Bike::query()->where('put_area_id',9)->where('put_status',Bike::PUT_STATUS_YES)->count(); $bar = $this->output->createProgressBar(count($sta)); $bar->start(); foreach ($sta as $v){ $body = json_decode($v->body,true); $body['put_bikes'] = $bikes; $v->body = json_encode($body); $v->save(); $bar->advance(); } $bar->finish(); } public function getWorkOrder($offset,$limit){ $workOrder = WorkOrder::query() ->offset($offset) ->limit($limit) ->get(); foreach ($workOrder as $v){ $v->warning_type = WorkOrder::$typeWarningMaps[$v->type]; $v->save(); } $this->line($offset); } }