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\OrderProduct;
|
||||
use App\Model\OrderProductItem;
|
||||
use App\Model\Product;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserShipAddress;
|
||||
use Extend\Wechat\WechatPay;
|
||||
@ -756,13 +757,38 @@ class PatientOrderService extends BaseService
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@ -1389,9 +1389,9 @@ class UserDoctorService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($order_inquiry as $value){
|
||||
$result[$value['order_inquiry_id']] = $value;
|
||||
$result[] = $value;
|
||||
}
|
||||
|
||||
return success($result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user