all(); $config = Config::get(); $appointment = AppointmentConfig::where(function ($query) use ($all) { if (isset($all['appointment_type_id'])) { $query->where('appointment_type_id', $all['appointment_type_id']); } })->where('show_front', 1)->get(); // 场地类型 $appointment_type = AppointmentType::get(); return $this->success(compact('config', 'appointment', 'appointment_type')); } /** * @OA\Get( * path="/api/mobile/other/banner", * tags={"小程序-其他"}, * summary="获取banner", * @OA\Parameter(name="position", in="query", @OA\Schema(type="integer"), required=true, description="位置1首页"), * @OA\Response( * response=200, * description="操作成功" * ) * ) */ public function banner() { $position = request('position', 1); $config = Banner::with('image')->where(function ($query) use ($position) { if (isset($position)) { $query->where('position', $position); } })->orderBy('sort')->get(); return $this->success($config); } /** * @OA\Get( * path="/api/mobile/other/company", * tags={"小程序-其他"}, * summary="公司搜索", * @OA\Parameter(name="company_name", in="query", @OA\Schema(type="integer"), required=true, description="公司名字"), * @OA\Response( * response=200, * description="操作成功" * ) * ) */ public function company() { $all = \request()->all(); $messages = [ 'company_name.required' => '公司名称必填', ]; $validator = Validator::make($all, [ 'company_name' => 'required', ], $messages); if ($validator->fails()) { return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]); } $YuanheRepository = new YuanheRepository(); $result = $YuanheRepository->companyInfo(['keyword' => $all['company_name']]); if (!$result) { return $this->fail([ResponseCode::ERROR_PARAMETER, '获取失败']); } return $this->success($result); } }