feat(store_order): 根据支付类型和用户ID创建订单
This commit is contained in:
parent
7cf5379755
commit
ac9eb17056
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user