diff --git a/app/Controller/BasicDataController.php b/app/Controller/BasicDataController.php index a324d9e..1c991fe 100644 --- a/app/Controller/BasicDataController.php +++ b/app/Controller/BasicDataController.php @@ -62,4 +62,15 @@ class BasicDataController extends AbstractController $data = $BasicDataService->getOperationManual(); return $this->response->json($data); } + + /** + * 获取操作手册详情 + * @return ResponseInterface + */ + public function getOperationManualInfo(): ResponseInterface + { + $BasicDataService = new BasicDataService(); + $data = $BasicDataService->getOperationManualInfo(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Model/OperationManual.php b/app/Model/OperationManual.php index 6eacac2..215592e 100644 --- a/app/Model/OperationManual.php +++ b/app/Model/OperationManual.php @@ -59,6 +59,6 @@ class OperationManual extends Model */ public static function getList(array $params, array $fields = ['*']): object|null { - return self::where($params)->get($fields); + return self::where($params)->orderBy('sort','desc')->get($fields); } } diff --git a/app/Services/BasicDataService.php b/app/Services/BasicDataService.php index 0e7c922..516d4e4 100644 --- a/app/Services/BasicDataService.php +++ b/app/Services/BasicDataService.php @@ -106,4 +106,24 @@ class BasicDataService extends BaseService return success($operation_manual->toArray()); } + + /** + * 获取操作手册详情 + * @return array + */ + public function getOperationManualInfo(): array + { + $manual_id = $this->request->route('manual_id'); + + $params = array(); + $params['manual_id'] = $manual_id; + $params['status'] = 1; + + $operation_manual = OperationManual::getOne($params); + if (empty($operation_manual)){ + return fail(); + } + + return success($operation_manual->toArray()); + } } \ No newline at end of file diff --git a/app/Utils/Auth.php b/app/Utils/Auth.php index 540c4cd..01aa3ba 100644 --- a/app/Utils/Auth.php +++ b/app/Utils/Auth.php @@ -16,13 +16,13 @@ class Auth $this->whiteApi = [ "/" => "*", "/patient/index" => "get", - "/login/wechat_mobile_login" => "post", - "/login/mobile_login" => "post", - "/code/phone" => "post", - "/disease/expertise" => "get", - "/area/province" => "get", - "/area/city" => "get", - "/area/county" => "get", + "/login/wechat_mobile_login" => "post", // 微信登陆 + "/login/mobile_login" => "post", // 手机号登陆 + "/code/phone" => "post",// 获取手机号验证码 + "/disease/expertise" => "get",// 疾病专长列表-搜索使用 + "/area/province" => "get",// 获取省份信息 + "/area/city" => "get", // 获取城市信息 + "/area/county" => "get", // 获取区县信息 ]; } diff --git a/config/routes.php b/config/routes.php index 7615c9f..8cac8c2 100644 --- a/config/routes.php +++ b/config/routes.php @@ -263,5 +263,8 @@ Router::addGroup('/basic', function () { // 获取操作手册列表 Router::get('/operation/manual', [BasicDataController::class, 'getOperationManual']); + + // 获取操作手册详情 + Router::get('/operation/manual/{manual_id:\d+}', [BasicDataController::class, 'getOperationManualInfo']); });