diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index ba689ab31..639433742 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -127,6 +127,7 @@ class StoreOrderController extends BaseAdminController $pay_type = (int)$this->request->post('pay_type'); $addressId = (int)$this->request->post('address_id'); $auth_code = $this->request->post('auth_code'); //微信支付条码 + $uid=$this->request->post('uid'); $params = $this->request->post(); if ($auth_code == '' && $pay_type != PayEnum::CASH_PAY && $pay_type != PayEnum::PURCHASE_FUNDS) { return $this->fail('支付条码不能为空'); @@ -135,8 +136,8 @@ class StoreOrderController extends BaseAdminController return $this->fail('购物车商品不能超过100个'); } $user = null; - if ($pay_type == PayEnum::PURCHASE_FUNDS) { - $user = User::where('id', $this->request->post('uid'))->find(); + if ($uid) { + $user = User::where('id', $uid)->find(); } $params['store_id'] = $this->request->adminInfo['store_id']; //当前登录的店铺id,用于判断是否是当前店铺的订单 $order = StoreOrderLogic::createOrder($cartId, $addressId, $user, $params); @@ -144,7 +145,7 @@ class StoreOrderController extends BaseAdminController switch ($pay_type) { case PayEnum::PURCHASE_FUNDS: //采购款支付 - PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $this->request->post('uid')]); + PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $uid]); return $this->success('采购款支付成功', ['id' => $order['id']]); case PayEnum::CASH_PAY: