修正获取患者问诊病例
This commit is contained in:
@@ -164,6 +164,10 @@ class UserPharmacistService extends BaseService
|
||||
return success($order_prescription->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 药师基本资料
|
||||
* @return array
|
||||
*/
|
||||
public function getPharmacistInfo(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
@@ -181,26 +185,37 @@ class UserPharmacistService extends BaseService
|
||||
return fail();
|
||||
}
|
||||
|
||||
$user['avatar'] = addAliyunOssWebsite($user['avatar']);
|
||||
|
||||
// 获取药师数据
|
||||
$fields = [
|
||||
'pharmacist_id',
|
||||
'pharmacist_id',
|
||||
'user_name',
|
||||
'pharmacist_title',
|
||||
'department_custom_name',
|
||||
];
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_pharmacist = UserPharmacist::getOne($params);
|
||||
$user_pharmacist = UserPharmacist::getOne($params,$fields);
|
||||
if (empty($user_pharmacist)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取药师详情数据
|
||||
$fields = [
|
||||
'card_name',
|
||||
'card_num',
|
||||
];
|
||||
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_pharmacist_info = UserPharmacistInfo::getOne($params);
|
||||
$params['pharmacist_id'] = $user_pharmacist['pharmacist_id'];
|
||||
$user_pharmacist_info = UserPharmacistInfo::getOne($params,$fields);
|
||||
if (empty($user_pharmacist_info)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
$result = array_merge($user->toArray(),$user_pharmacist->toArray(),$user_pharmacist_info->toArray());
|
||||
|
||||
return success($result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user