获取患者进行中的检测订单
This commit is contained in:
@@ -18,6 +18,7 @@ use App\Model\PatientFamily;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserLocation;
|
||||
use App\Utils\Log;
|
||||
use App\Utils\PcreMatch;
|
||||
use Extend\Wechat\WechatPay;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\DbConnection\Db;
|
||||
@@ -474,7 +475,7 @@ class DetectionService extends BaseService
|
||||
* 获取患者进行中的检测订单
|
||||
* @return array
|
||||
*/
|
||||
public function getDetectionDoctorOrderFirst(): array
|
||||
public function getDetectionOrderFirst(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
@@ -493,6 +494,63 @@ class DetectionService extends BaseService
|
||||
|
||||
}
|
||||
|
||||
// 绑定检测管
|
||||
public function bindDetectionTube(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_detection_id = $this->request->route("order_detection_id");
|
||||
|
||||
$request_params = $this->request->all();
|
||||
|
||||
if (count($request_params['detection_pic']) < 1){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"请上传检测管图片");
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['order_detection_id'] = $order_detection_id;
|
||||
$order_detection = OrderDetection::getOne($params);
|
||||
if (empty($order_detection)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 检测订单状态
|
||||
if ($order_detection['detection_status'] != 2){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"订单状态错误");
|
||||
}
|
||||
|
||||
if ($order_detection['detection_pay_status'] != 2){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"订单未支付");
|
||||
}
|
||||
|
||||
if (!empty($order_detection['detection_bar_code'])){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"请勿重复绑定");
|
||||
}
|
||||
|
||||
if (!empty($order_detection['detection_pic'])){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"请勿重复绑定");
|
||||
}
|
||||
|
||||
// 处理检测管图片
|
||||
$detection_pic = implode(',', $request_params['detection_pic']);
|
||||
$detection_pic = PcreMatch::pregRemoveOssWebsite($detection_pic);
|
||||
|
||||
$data = array();
|
||||
$data['detection_pic'] = $detection_pic;
|
||||
$data['detection_bar_code'] = $request_params['detection_bar_code'];
|
||||
$data['detection_status'] = 3;
|
||||
|
||||
$params = array();
|
||||
$params['order_detection_id'] = $order_detection_id;
|
||||
$res = OrderDetection::editOrderDetection($params,$data);
|
||||
if (!$res){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"绑定失败");
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消未支付检测订单
|
||||
* @param string|int $order_no 订单编号
|
||||
|
||||
Reference in New Issue
Block a user