where([ ['id','=',$storeId], ['is_rest','=',0], ['status','=',2] ]) ->select('time1','time2','time3','time4') ->first(); if(!empty($store)){ $nowTime = time(); $time1 = strtotime(($store->time1)); $time2 = strtotime(($store->time2)); if($time1 < $nowTime && $nowTime < $time2){ return true; } $time3 = strtotime(($store->time3)); $time4 = strtotime(($store->time4)); if($time3 < $nowTime && $nowTime < $time4){ return true; } } return false; } public function undo() { // TODO: Implement undo() method. } public function detail($storeId) { return Store::query() ->with('market') ->where('id',$storeId) ->first()->toArray(); } }