/** * Display a listing of the resource. * * @return Response */ public function index() { $input = Input::all(); $sessionId = Common::checkSessionLogin($input); $categoryArray = CommonCategory::categoryArray(); $typeArray = CommonCategory::typeArray(); $cityArray = Common::listCity(); $data = array('categoryArray' => $categoryArray, 'typeArray' => $typeArray, 'cityArray' => $cityArray); return Common::returnData(200, SUCCESS, $input['user_id'], $sessionId, $data); }
public static function searchFormData($searchId = 0) { $priceArray = self::priceFormArray(); $categoryArray = self::categoryFormArray(); // $categoryArray = CommonCategory::categoryArray(); // $typeArray = selectProductType(); $typeArray = CommonCategory::typeArray(); $timeArray = CommonCategory::timeArray(); $cityArray = Common::listCity(); $id = null; $name = null; $lat = null; $long = null; $price_id = null; $category_id = null; $type_id = null; $time_id = null; $city_id = null; if ($searchId > 0) { $search = Search::find($searchId); if (count($search) > 0) { $id = $searchId; $name = $search->name; $lat = $search->lat; $long = $search->long; $city_id = $search->city_id; $price_id = $search->price_id; $category_id = $search->category_id; $type_id = $search->type_id; $time_id = $search->time_id; $city = $search->city; } } $data = array('id' => $id, 'name' => $name, 'lat' => $lat, 'long' => $long, 'city_id' => $city_id, 'price_id' => $price_id, 'category_id' => $category_id, 'type_id' => $type_id, 'time_id' => $time_id, 'categoryArray' => $categoryArray, 'typeArray' => $typeArray, 'timeArray' => $timeArray, 'cityArray' => $cityArray); return $data; }