新增获取问诊最低价格
This commit is contained in:
parent
53d9e2072d
commit
d8d30b9328
@ -84,8 +84,16 @@ class InquiryController extends AbstractController
|
|||||||
return $this->response->json($data);
|
return $this->response->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取问诊最低价格
|
||||||
|
* @return ResponseInterface
|
||||||
|
*/
|
||||||
|
public function getInquiryLowestPrice(): ResponseInterface
|
||||||
|
{
|
||||||
|
$InquiryService = new InquiryService();
|
||||||
|
$data = $InquiryService->getInquiryLowestPrice();
|
||||||
|
return $this->response->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -141,4 +141,20 @@ class PatientOrderController extends AbstractController
|
|||||||
$data = $PatientOrderService->getPatientOrderPayInfo();
|
$data = $PatientOrderService->getPatientOrderPayInfo();
|
||||||
return $this->response->json($data);
|
return $this->response->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建药品订单
|
||||||
|
* @return ResponseInterface
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function addPatientProductOrder(): ResponseInterface
|
||||||
|
{
|
||||||
|
$request = $this->container->get(PatientOrderRequest::class);
|
||||||
|
$request->scene('addPatientProductOrder')->validateResolved();
|
||||||
|
|
||||||
|
$PatientOrderService = new PatientOrderService();
|
||||||
|
$data = $PatientOrderService->addPatientProductOrder();
|
||||||
|
return $this->response->json($data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -20,13 +20,13 @@ class SystemController extends AbstractController
|
|||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
public function getSystemInquiryConfig(): ResponseInterface
|
public function getSystemInquiryTime(): ResponseInterface
|
||||||
{
|
{
|
||||||
$request = $this->container->get(SystemRequest::class);
|
$request = $this->container->get(SystemRequest::class);
|
||||||
$request->scene('getSystemInquiryConfig')->validateResolved();
|
$request->scene('getSystemInquiryTime')->validateResolved();
|
||||||
|
|
||||||
$SystemService = new SystemService();
|
$SystemService = new SystemService();
|
||||||
$data = $SystemService->getSystemInquiryConfig();
|
$data = $SystemService->getSystemInquiryTime();
|
||||||
return $this->response->json($data);
|
return $this->response->json($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,4 +94,14 @@ class DoctorInquiryConfig extends Model
|
|||||||
{
|
{
|
||||||
return self::where($params)->update($data);
|
return self::where($params)->update($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取问诊价格最低的字段
|
||||||
|
* @param array $params
|
||||||
|
* @return mixed|string|null
|
||||||
|
*/
|
||||||
|
public static function getMinInquiryPriceMinOne(array $params = []): mixed
|
||||||
|
{
|
||||||
|
return self::where($params)->min('inquiry_price');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,8 @@ class PatientOrderRequest extends FormRequest
|
|||||||
"order_type", // 订单类型(1:问诊订单 2:药品订单)
|
"order_type", // 订单类型(1:问诊订单 2:药品订单)
|
||||||
"order_no"// 订单编号
|
"order_no"// 订单编号
|
||||||
],
|
],
|
||||||
|
'addPatientProductOrder' => [ // 创建药品订单
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -10,7 +10,7 @@ use Hyperf\Validation\Request\FormRequest;
|
|||||||
class SystemRequest extends FormRequest
|
class SystemRequest extends FormRequest
|
||||||
{
|
{
|
||||||
protected array $scenes = [
|
protected array $scenes = [
|
||||||
'getSystemInquiryConfig' => [ // 获取系统问诊配置 快速问诊-问诊购药
|
'getSystemInquiryTime' => [ // 获取系统问诊配置 快速问诊-问诊购药
|
||||||
'inquiry_type', // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
'inquiry_type', // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||||
'inquiry_mode', // 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
'inquiry_mode', // 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||||
],
|
],
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use App\Constants\DoctorTitleCode;
|
|||||||
use App\Constants\HttpEnumCode;
|
use App\Constants\HttpEnumCode;
|
||||||
use App\Exception\BusinessException;
|
use App\Exception\BusinessException;
|
||||||
use App\Model\DiseaseClass;
|
use App\Model\DiseaseClass;
|
||||||
|
use App\Model\DoctorInquiryConfig;
|
||||||
use App\Model\Hospital;
|
use App\Model\Hospital;
|
||||||
use App\Model\InquiryCaseProduct;
|
use App\Model\InquiryCaseProduct;
|
||||||
use App\Model\OrderEvaluation;
|
use App\Model\OrderEvaluation;
|
||||||
@ -18,6 +19,7 @@ use App\Model\PatientFamily;
|
|||||||
use App\Model\PatientFamilyHealth;
|
use App\Model\PatientFamilyHealth;
|
||||||
use App\Model\PatientFamilyPersonal;
|
use App\Model\PatientFamilyPersonal;
|
||||||
use App\Model\Product;
|
use App\Model\Product;
|
||||||
|
use App\Model\SystemInquiryConfig;
|
||||||
use App\Model\UserCoupon;
|
use App\Model\UserCoupon;
|
||||||
use App\Model\UserDoctor;
|
use App\Model\UserDoctor;
|
||||||
use App\Model\UserPatient;
|
use App\Model\UserPatient;
|
||||||
@ -482,6 +484,73 @@ class InquiryService extends BaseService
|
|||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getInquiryLowestPrice(){
|
||||||
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
$doctor_id = $this->request->input('doctor_id');
|
||||||
|
|
||||||
|
// 快速
|
||||||
|
$quick_inquiry_price = 0;
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_type'] = 2;
|
||||||
|
$params['inquiry_mode'] = 1;
|
||||||
|
$system_inquiry_config = SystemInquiryConfig::getOne($params);
|
||||||
|
if (!empty($system_inquiry_config)){
|
||||||
|
$quick_inquiry_price = $system_inquiry_config['inquiry_price'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 问诊购药
|
||||||
|
$medicine_inquiry_price = 0;
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_type'] = 4;
|
||||||
|
$params['inquiry_mode'] = 1;
|
||||||
|
$system_inquiry_config = SystemInquiryConfig::getOne($params);
|
||||||
|
if (!empty($system_inquiry_config)){
|
||||||
|
$medicine_inquiry_price = $system_inquiry_config['inquiry_price'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 专家问诊
|
||||||
|
$expert_inquiry_price = 0;
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_type'] = 1;
|
||||||
|
$params['inquiry_mode'] = 1;
|
||||||
|
$expert_inquiry_price = DoctorInquiryConfig::getMinInquiryPriceMinOne($params);
|
||||||
|
if (empty($expert_inquiry_price) || $expert_inquiry_price == 0){
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_type'] = 1;
|
||||||
|
$params['inquiry_mode'] = 1;
|
||||||
|
$system_inquiry_config = SystemInquiryConfig::getOne($params);
|
||||||
|
if (!empty($system_inquiry_config)){
|
||||||
|
$expert_inquiry_price = $system_inquiry_config['min_inquiry_price'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 公益问诊
|
||||||
|
$welfare_inquiry_price = 0;
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_type'] = 1;
|
||||||
|
$params['inquiry_mode'] = 1;
|
||||||
|
$welfare_inquiry_price = DoctorInquiryConfig::getMinInquiryPriceMinOne($params);
|
||||||
|
|
||||||
|
if (empty($welfare_inquiry_price) || $welfare_inquiry_price == 0){
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_type'] = 1;
|
||||||
|
$params['inquiry_mode'] = 1;
|
||||||
|
$system_inquiry_config = SystemInquiryConfig::getOne($params);
|
||||||
|
if (!empty($system_inquiry_config)){
|
||||||
|
$inquiry_price = explode(',',$system_inquiry_config['inquiry_price']);
|
||||||
|
$welfare_inquiry_price = $inquiry_price[0] ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
$result['quick_inquiry_price'] = $quick_inquiry_price;
|
||||||
|
$result['medicine_inquiry_price'] = $medicine_inquiry_price;
|
||||||
|
$result['expert_inquiry_price'] = $expert_inquiry_price;
|
||||||
|
$result['welfare_inquiry_price'] = $welfare_inquiry_price;
|
||||||
|
|
||||||
|
return success($result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取医生未接诊订单数量
|
* 获取医生未接诊订单数量
|
||||||
* @param string $doctor_id 医生id
|
* @param string $doctor_id 医生id
|
||||||
|
|||||||
@ -701,4 +701,8 @@ class PatientOrderService extends BaseService
|
|||||||
|
|
||||||
return success($result);
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addPatientProductOrder(){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ class SystemService extends BaseService
|
|||||||
* 快速问诊-问诊购药
|
* 快速问诊-问诊购药
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getSystemInquiryConfig(): array
|
public function getSystemInquiryTime(): array
|
||||||
{
|
{
|
||||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
|
||||||
|
|||||||
@ -204,6 +204,9 @@ Router::addGroup('/patient', function () {
|
|||||||
|
|
||||||
// 新增问诊评价
|
// 新增问诊评价
|
||||||
Router::post('/evaluation', [InquiryController::class, 'addInquiryEvaluation']);
|
Router::post('/evaluation', [InquiryController::class, 'addInquiryEvaluation']);
|
||||||
|
|
||||||
|
// 获取问诊最低价格
|
||||||
|
Router::get('/lowest-price', [InquiryController::class, 'getInquiryLowestPrice']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 医生数据
|
// 医生数据
|
||||||
@ -306,7 +309,7 @@ Router::addGroup('/patient', function () {
|
|||||||
Router::delete('/{order_product_id:\d+}', [PatientOrderController::class, 'deletePatientProductOrder']);
|
Router::delete('/{order_product_id:\d+}', [PatientOrderController::class, 'deletePatientProductOrder']);
|
||||||
|
|
||||||
// 创建药品订单-未开发
|
// 创建药品订单-未开发
|
||||||
Router::post('', [PatientOrderController::class, 'imCallBack']);
|
Router::post('', [PatientOrderController::class, 'addPatientProductOrder']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 处方订单
|
// 处方订单
|
||||||
@ -422,8 +425,8 @@ Router::get('/evaluation', [UserDoctorController::class, 'getDoctorEvaluationLis
|
|||||||
Router::addGroup('/system', function () {
|
Router::addGroup('/system', function () {
|
||||||
// 问诊
|
// 问诊
|
||||||
Router::addGroup('/inquiry', function () {
|
Router::addGroup('/inquiry', function () {
|
||||||
// 获取系统问诊配置 快速问诊-问诊购药
|
// 获取系统问诊时间 快速问诊-问诊购药
|
||||||
Router::get('/config', [SystemController::class, 'getSystemInquiryConfig']);
|
Router::get('/time', [SystemController::class, 'getSystemInquiryTime']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user