1
This commit is contained in:
parent
7e7b220a2b
commit
3f72c02b9f
@ -71,4 +71,15 @@ class UserPharmacistController extends AbstractController
|
||||
$data = $UserPharmacistService->putPrescriptionVerify();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 药师基本资料
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getPharmacistInfo(): ResponseInterface
|
||||
{
|
||||
$UserPharmacistService = new UserPharmacistService();
|
||||
$data = $UserPharmacistService->getPharmacistInfo();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,12 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $status 状态(0:禁用 1:正常 2:删除)
|
||||
* @property int $is_online 是否在线(0:不在线 1:在线)
|
||||
* @property string $avatar 头像
|
||||
* @property int $pharmacist_title 职称
|
||||
* @property int $department_custom_id 科室id-自定义
|
||||
* @property string $department_custom_name 科室名称(如未自己输入,填入标准科室名称)
|
||||
* @property string $department_custom_mobile 科室电话
|
||||
* @property string $medical_institution 医疗机构名称
|
||||
* @property string $worker_date 医龄
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
@ -33,12 +39,7 @@ class UserPharmacist extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['pharmacist_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'is_online', 'avatar', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['pharmacist_id' => 'integer', 'user_id' => 'integer', 'status' => 'integer', 'sex' => 'integer', 'age' => 'integer', 'is_online' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $fillable = ['pharmacist_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'is_online', 'avatar', 'pharmacist_title', 'department_custom_id', 'department_custom_name', 'department_custom_mobile', 'medical_institution', 'worker_date', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "pharmacist_id";
|
||||
|
||||
|
||||
79
app/Model/UserPharmacistInfo.php
Normal file
79
app/Model/UserPharmacistInfo.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $info_id 主键id
|
||||
* @property int $pharmacist_id 药师id
|
||||
* @property int $card_type 类型(1:身份证 2:护照 3:港澳通行证 4:台胞证)
|
||||
* @property string $card_name 证件姓名
|
||||
* @property string $card_name_mask 证件姓名(掩码)
|
||||
* @property string $card_num 证件号码
|
||||
* @property string $card_num_mask 证件号码(掩码)
|
||||
* @property string $license_cert 医师执业证(逗号分隔)
|
||||
* @property string $qualification_cert 医师资格证(逗号分隔)
|
||||
* @property string $qualification_cert_num 医师资格证号(逗号分隔)
|
||||
* @property string $work_cert 医师工作证(逗号分隔)
|
||||
* @property string $multi_point_images 多点执业备案信息(逗号分隔)
|
||||
* @property string $id_card_front 身份证正面图片
|
||||
* @property string $id_card_back 身份证背面图片
|
||||
* @property string $sign_image 签名图片
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
class UserPharmacistInfo extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'user_pharmacist_info';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['info_id', 'pharmacist_id', 'card_type', 'card_name', 'card_name_mask', 'card_num', 'card_num_mask', 'license_cert', 'qualification_cert', 'qualification_cert_num', 'work_cert', 'multi_point_images', 'id_card_front', 'id_card_back', 'sign_image', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "info_id";
|
||||
|
||||
/**
|
||||
* 获取是否存在
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public static function getExists(array $params): bool
|
||||
{
|
||||
return self::where($params)->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @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 Collection|array
|
||||
*/
|
||||
public static function getList(array $params = [], array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,6 +19,7 @@ class UserPharmacistRequest extends FormRequest
|
||||
],
|
||||
'putPrescriptionVerify' => [ // 审核处方
|
||||
'pharmacist_audit_status',// 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
'pharmacist_fail_reason',// 药师审核驳回原因
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ class UserDoctorService extends BaseService
|
||||
$data = array();
|
||||
$data['bank_card_id'] = $doctor_bank_card['bank_card_id'];
|
||||
$data['bank_img_path'] = addAliyunOssWebsite($doctor_bank_card['BasicBank']['bank_img_path']);
|
||||
$data['bank_name'] = addAliyunOssWebsite($doctor_bank_card['BasicBank']['bank_name']);
|
||||
$data['bank_name'] = $doctor_bank_card['BasicBank']['bank_name'];
|
||||
$data['bank_card_code_mask'] = $doctor_bank_card['bank_card_code_mask'];
|
||||
|
||||
unset($doctor_bank_card);
|
||||
@ -1313,9 +1313,16 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "非法医生");
|
||||
}
|
||||
|
||||
$res = $this->checkDoctorAuth($user_doctor);
|
||||
if ($res !== true) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, $res);
|
||||
if ($user_doctor['iden_auth_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先完成身份认证");
|
||||
}
|
||||
|
||||
if ($user_doctor['idcard_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先完成实名认证");
|
||||
}
|
||||
|
||||
if ($user_doctor['is_bind_bank'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先绑定结算银行卡");
|
||||
}
|
||||
|
||||
// 获取医生医院
|
||||
|
||||
@ -113,6 +113,7 @@ class UserPharmacistService extends BaseService
|
||||
|
||||
$order_prescription_id = $this->request->route('order_prescription_id');
|
||||
$pharmacist_audit_status = $this->request->route('pharmacist_audit_status');
|
||||
$pharmacist_fail_reason = $this->request->route('pharmacist_fail_reason');
|
||||
|
||||
// 验证器未验证未0的情况
|
||||
if ($pharmacist_audit_status == 0){
|
||||
@ -154,8 +155,28 @@ class UserPharmacistService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方已审核,请勿重复审核");
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
return success($order_prescription->toArray());
|
||||
}
|
||||
|
||||
public function getPharmacistInfo(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
// 获取药师数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_pharmacist = UserPharmacist::getOne($params);
|
||||
if (empty($user_pharmacist)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取药师详情数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
|
||||
}
|
||||
}
|
||||
@ -376,6 +376,9 @@ Router::addGroup('/pharmacist', function () {
|
||||
// 审核处方
|
||||
Router::put('/verify/{order_prescription_id:\d+}', [UserPharmacistController::class, 'putPrescriptionVerify']);
|
||||
});
|
||||
|
||||
// 药师基本资料
|
||||
Router::get('/info', [UserPharmacistController::class, 'getPharmacistInfo']);
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user