示例#1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $cities = City::select('city_name')->distinct()->get();
     $rests = Rest::select('rest_type')->distinct()->get();
     $content['cities'] = $cities;
     $content['rests'] = $rests;
     return view('index', $content);
 }
示例#2
0
 private function getRestId($rest)
 {
     $restIdDb = Rest::select('rest_id')->where('rest_type', 'LIKE', '%' . $rest . '%')->get();
     $restId = array();
     if (count($restIdDb) > 0) {
         for ($i = 0; $i < count($restIdDb); $i++) {
             $restId[$i] = $restIdDb[$i]['rest_id'];
         }
         return $restId;
     } else {
         return $restId = null;
     }
 }