1
This commit is contained in:
parent
b688cc6e3b
commit
6cb3cda74b
@ -11,6 +11,7 @@ use App\Model\OrderPrescription;
|
|||||||
use App\Model\OrderPrescriptionProduct;
|
use App\Model\OrderPrescriptionProduct;
|
||||||
use App\Model\OrderProduct;
|
use App\Model\OrderProduct;
|
||||||
use App\Model\OrderProductItem;
|
use App\Model\OrderProductItem;
|
||||||
|
use App\Model\Product;
|
||||||
use App\Model\UserDoctor;
|
use App\Model\UserDoctor;
|
||||||
use App\Model\UserShipAddress;
|
use App\Model\UserShipAddress;
|
||||||
use Extend\Wechat\WechatPay;
|
use Extend\Wechat\WechatPay;
|
||||||
@ -756,12 +757,37 @@ class PatientOrderService extends BaseService
|
|||||||
return fail(HttpEnumCode::HTTP_ERROR,"处方药品错误");
|
return fail(HttpEnumCode::HTTP_ERROR,"处方药品错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
dump($order_prescription_product->toArray());
|
// 检测药品是否存在,库存是否足够
|
||||||
|
foreach ($order_prescription_product as $value){
|
||||||
|
$params = array();
|
||||||
|
$params['product_id'] = $value['product_id'];
|
||||||
|
$product = Product::getOne($params);
|
||||||
|
if (empty($product)){
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR,"处方存在未知药品");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Db::beginTransaction();
|
||||||
|
try {
|
||||||
|
// 新增药品订单
|
||||||
|
$data = array();
|
||||||
|
$data['order_inquiry_id'] = $order_prescription['order_inquiry_id'];
|
||||||
|
$data['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||||
|
$data['doctor_id'] = $order_prescription['doctor_id'];
|
||||||
|
$data['patient_id'] = $order_prescription['patient_id'];
|
||||||
|
|
||||||
|
// 新增药品订单详情
|
||||||
|
// 修正处方使用状态
|
||||||
|
// 新增取消订单队列
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollBack();
|
||||||
|
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 新增药品订单
|
|
||||||
// 新增药品订单详情
|
|
||||||
// 修正处方使用状态
|
|
||||||
// 新增取消订单队列
|
|
||||||
|
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1389,9 +1389,9 @@ class UserDoctorService extends BaseService
|
|||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = [];
|
||||||
foreach ($order_inquiry as $value){
|
foreach ($order_inquiry as $value){
|
||||||
$result[$value['order_inquiry_id']] = $value;
|
$result[] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return success($result);
|
return success($result);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user