protected function fetchQue() { $que = FVSyncQue::find($this->option('id')); if (NULL === $que) { throw new \Exception("Not found with given id {$this->option('id')}"); } if (FVSyncType::ID_LIST !== $que->type_id) { throw new \Exception('Unvalid Que type!'); } return $que; }
/** * Execute the console command. * * @return mixed */ public function handle() { $ques = FVSyncQue::where('updated_at', '<=', Carbon::now()->subHours(self::SUBHOURS))->whereIn('status_code', [FVSyncQue::STATUS_INIT, FVSyncQue::STATUS_WRITING, FVSyncQue::STATUS_IMPORTING])->get(); return 0 === $ques->count() ? NULL : $this->notify($ques); }
public function hasProcessingQue() { $num = FVSyncQue::where('type_id', '=', FVSyncType::where('name', '=', $this->getType())->first()->id)->whereIn('status_code', [FVSyncQue::STATUS_WRITING, FVSyncQue::STATUS_IMPORTING])->count(); return 0 < $num; }
protected function fetchDelayQue() { return FVSyncQue::delay()->first(); }
public function show(FVSyncQue $que) { pr($que->getAttributes()); pr($que->conditions); }