public function searchUser() { $type = Input::get("type"); $companyName = Input::get("companyName", ""); $licenseCode = Input::get("licenseCode", ""); if ($type == "companyName") { $users = BusinessUser::where("business_name", "like", "%" . $companyName . "%")->with("user")->get(); } if ($type == "licenseCode") { $users = BusinessUser::where("business_licence_no", "like", "%" . $licenseCode . "%")->with("user")->get(); } if (count($users) == 0) { return Response::json(array('errCode' => 0, 'users' => array())); } return Response::json(array('errCode' => 0, 'users' => $users)); }
public function changeServiceUnivalence() { $userId = Input::get("user_id"); $user = BusinessUser::where("user_id", "=", $userId)->get(); $agencyUnivalence = BusinessController::getServiceFee($userId); $expressUnivalence = BusinessController::getExpressFee($userId); $defaultAgencyUnivalence = DB::table('fee_types')->select('number')->where("category", "30")->where("item", "1")->first(); $defaultExpressUnivalence = DB::table('fee_types')->select('number')->where("category", "20")->where("item", "1")->first(); return View::make('pages.admin.business-center.change-service-univalence', ["defaultExpressUnivalence" => $defaultExpressUnivalence->number, "defaultAgencyUnivalence" => $defaultAgencyUnivalence->number, "expressUnivalence" => $expressUnivalence, "agencyUnivalence" => $agencyUnivalence, "username" => $user[0]->business_name, "userId" => $userId]); }