diff --git a/app/Controller/UserDoctorController.php b/app/Controller/UserDoctorController.php index 49dc83f..0c559fd 100644 --- a/app/Controller/UserDoctorController.php +++ b/app/Controller/UserDoctorController.php @@ -72,4 +72,15 @@ class UserDoctorController extends AbstractController $data = $DoctorInquiryService->putInquiryConfig(); return $this->response->json($data); } + + /** + * 获取医生银行卡 + * @return ResponseInterface + */ + public function getDoctorBankCard(): ResponseInterface + { + $UserDoctorService = new UserDoctorService(); + $data = $UserDoctorService->getDoctorBankCard(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Model/BasicBank.php b/app/Model/BasicBank.php new file mode 100644 index 0000000..c5e81b5 --- /dev/null +++ b/app/Model/BasicBank.php @@ -0,0 +1,61 @@ + 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime']; + + protected string $primaryKey = "bank_id"; + + /** + * 获取信息-单条 + * @param array $params + * @param array $fields + * @return object|null + */ + public static function getOne(array $params, array $fields = ['*']): object|null + { + return self::where($params)->first($fields); + } + + /** + * 获取信息-多条 + * @param array $params + * @param array $fields + * @return object|null + */ + public static function getList(array $params, array $fields = ['*']): object|null + { + return self::where($params)->get($fields); + } +} diff --git a/app/Model/DoctorBankCard.php b/app/Model/DoctorBankCard.php new file mode 100644 index 0000000..8009fc0 --- /dev/null +++ b/app/Model/DoctorBankCard.php @@ -0,0 +1,95 @@ + 'integer', 'doctor_id' => 'integer', 'bank_id' => 'integer', 'province_id' => 'integer', 'city_id' => 'integer', 'county_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime']; + + protected string $primaryKey = "bank_card_id"; + + /** + * 关联银行表 + */ + public function BasicBank(): HasOne + { + return $this->hasOne(BasicBank::class, 'bank_id','bank_id'); + } + + /** + * 获取信息-单条 + * @param array $params + * @param array $fields + * @return object|null + */ + public static function getOne(array $params, array $fields = ['*']): object|null + { + return self::where($params)->first($fields); + } + + /** + * 获取信息-多条 + * @param array $params + * @param array $fields + * @return object|null + */ + public static function getList(array $params, array $fields = ['*']): object|null + { + return self::where($params)->get($fields); + } + + + /** + * 获取医生银行卡列表 + * 关联银行表 + * @param array $params + * @param array $fields + * @return DoctorBankCard[]|Builder[]|Collection + */ + public static function getWithBankList(array $params, array $fields = ['*']): Collection|array + { + return self::with(['BasicBank'])->where($params)->get($fields); + } +} diff --git a/app/Services/IndexService.php b/app/Services/IndexService.php index 214ccef..376d4be 100644 --- a/app/Services/IndexService.php +++ b/app/Services/IndexService.php @@ -95,7 +95,7 @@ class IndexService extends BaseService $info['user_name'] = $doctor['user_name']; $info['status'] = $doctor['status']; $info['idcard_status'] = $doctor['idcard_status'];// 实名认证状态(0:未认证 1:认证通过 2:认证失败) - $info['iden_auth_status'] = $doctor['idcard_status'];// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) + $info['iden_auth_status'] = $doctor['iden_auth_status'];// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) $info['multi_point_status'] = $doctor['multi_point_status'];// 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) $info['is_bind_bank'] = $doctor['is_bind_bank'];// 是否已绑定结算银行卡(0:否 1:是) $info['avatar'] = $doctor['avatar']; diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index b9d7e42..232947a 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -73,4 +73,13 @@ class UserDoctorService extends BaseService return $doctor_expertise->toArray(); } + + // 获取医生银行卡 + public function getDoctorBankCard(){ + $user_info = $this->request->getAttribute("userInfo") ?? []; + + $params = array(); + $params['doctor_id'] = $user_info['client_user_id']; +// $doctor_bank_card = + } } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index a5abaae..15171ab 100644 --- a/config/routes.php +++ b/config/routes.php @@ -78,11 +78,10 @@ Router::addGroup('/doctor', function () { //银行卡 Router::addGroup('/bank', function () { // 获取医生银行卡 - Router::get('/card', [UserDoctorController::class, 'getInquiryConfig']); + Router::get('', [UserDoctorController::class, 'getDoctorBankCard']); }); }); - /** * ------------患者端api--------------------- */