|
@@ -94,6 +94,24 @@ class Order extends BaseModel
|
|
$order = Order::with(['organization', 'orderVaccine', 'orderNurse', 'orderPack'])->where('id', $order_id)->first()->toArray();
|
|
$order = Order::with(['organization', 'orderVaccine', 'orderNurse', 'orderPack'])->where('id', $order_id)->first()->toArray();
|
|
$orderPatient = OrderPatient::where('order_id', $order_id)->first();
|
|
$orderPatient = OrderPatient::where('order_id', $order_id)->first();
|
|
$user = User::where('id', $order['user_id'])->first();
|
|
$user = User::where('id', $order['user_id'])->first();
|
|
|
|
+ //更新订单
|
|
|
|
+ $order_status = 2;
|
|
|
|
+ if (in_array($order['product_type'], [3,4,5])) {
|
|
|
|
+ $order_status = 7;
|
|
|
|
+ }
|
|
|
|
+ elseif ($order['product_type'] == 6) {
|
|
|
|
+ $order_status = 3;
|
|
|
|
+ }
|
|
|
|
+ elseif ($order['product_type'] == 7) {
|
|
|
|
+ $order_status = 4;
|
|
|
|
+ //改变用户余额
|
|
|
|
+ User::changeBalance($order['user_id'], $order['total_amount'], 2, $order['id'], '充值');
|
|
|
|
+ }
|
|
|
|
+ Order::where('id', $order_id)->update([
|
|
|
|
+ 'order_status' => $order_status,
|
|
|
|
+ 'payment_status' => 2,
|
|
|
|
+ 'payment_time' => time(),
|
|
|
|
+ ]);
|
|
//发送下单消息
|
|
//发送下单消息
|
|
if ($order['product_type'] < 6) {
|
|
if ($order['product_type'] < 6) {
|
|
$product_type_text = config('config.product_type_map')[$order['product_type']];
|
|
$product_type_text = config('config.product_type_map')[$order['product_type']];
|