新增获取处方详情接口
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\UserPharmacist;
|
||||
|
||||
/**
|
||||
* 药师
|
||||
*/
|
||||
@@ -21,12 +25,81 @@ class UserPharmacistService extends BaseService
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$prescription = $OrderPrescriptionService->getPharmacistWaitAuditPage($user_info['client_user_id'],$pharmacist_audit_status,$platform_audit_status,$page,$per_page);
|
||||
if (!empty($prescription['data'])){
|
||||
foreach ($prescription['data'] as &$item){
|
||||
$prescription = $OrderPrescriptionService->getPharmacistWaitAuditPage($user_info['client_user_id'], $pharmacist_audit_status, $platform_audit_status, $page, $per_page);
|
||||
if (!empty($prescription['data'])) {
|
||||
foreach ($prescription['data'] as &$item) {
|
||||
$item['prescription_img'] = addAliyunOssWebsite($item['prescription_img']);
|
||||
}
|
||||
}
|
||||
return success($prescription);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置上下线
|
||||
* @return array
|
||||
*/
|
||||
public function putOnOff(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$is_online = $this->request->input('is_online');
|
||||
|
||||
// 获取药师数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_pharmacist = UserPharmacist::getOne($params);
|
||||
if (empty($user_pharmacist)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['is_online'] = $is_online;
|
||||
|
||||
$params = array();
|
||||
$params['pharmacist_id'] = $user_pharmacist['pharmacist_id'];
|
||||
UserPharmacist::editUserPharmacist($params, $data);
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处方详情
|
||||
* @return array
|
||||
*/
|
||||
public function getPrescriptionInfo(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_prescription_id = $this->request->route('order_prescription_id');
|
||||
|
||||
// 获取药师数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_pharmacist = UserPharmacist::getOne($params);
|
||||
if (empty($user_pharmacist)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取处方数据
|
||||
$fields = [
|
||||
"order_prescription_id",
|
||||
"order_inquiry_id",
|
||||
"prescription_status",
|
||||
"pharmacist_audit_status",
|
||||
"platform_audit_status",
|
||||
"prescription_img",
|
||||
];
|
||||
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$params['pharmacist_id'] = $user_info['client_user_id'];
|
||||
$order_prescription = OrderPrescription::getOne($params, $fields);
|
||||
if (empty($order_prescription)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
$order_prescription['prescription_img'] = addAliyunOssWebsite($order_prescription['prescription_img']);
|
||||
|
||||
return success($order_prescription->toArray());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user