diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 5e4ccee80..06d8175df 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -72,6 +72,7 @@ class OrderLogic extends BaseLogic if (isset($check) && $check['status'] == 1) { $find['price'] = $productBase['ot_price']; } + unset($cart_select[$k]['id']); //利润 $onePrice = bcsub($productBase['price'], $productBase['ot_price'], 2); $cart_select[$k]['profit'] = bcmul($v['cart_num'], $onePrice, 2);//利润 diff --git a/app/common/logic/store_order/StoreOrderLogic.php b/app/common/logic/store_order/StoreOrderLogic.php index 0218eca15..59f8c3ea4 100644 --- a/app/common/logic/store_order/StoreOrderLogic.php +++ b/app/common/logic/store_order/StoreOrderLogic.php @@ -43,8 +43,10 @@ class StoreOrderLogic extends BaseLogic if (!$find) { continue; } + unset($cart_select[$k]['id']); $cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2); //钱 $cart_select[$k]['price'] = $find['price']; + $cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2);//钱 $cart_select[$k]['product_id'] = $v['product_id']; $cart_select[$k]['old_cart_id'] = $v['id']; $cart_select[$k]['cart_num'] = $v['cart_num']; @@ -130,7 +132,8 @@ class StoreOrderLogic extends BaseLogic $order = StoreOrder::create($_order); $goods_list = $orderInfo['cart_list']; foreach ($goods_list as $k => $v) { - $goods_list[$k]['oid'] = $order->id; + $goods_list[$k]['oid'] = 153; + $goods_list[$k]['uid'] = 0; $goods_list[$k]['cart_id'] = implode(',', $cartId); $goods_list[$k]['delivery_id'] = $params['store_id']; //商家id } diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index 6a556e7ff..adcb02640 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -181,15 +181,15 @@ class StoreOrderController extends BaseAdminController public function pay() { - $order_id = (int)$this->request->post('order_id'); - $pay_type = (int)$this->request->post('pay_type'); + $order_id = $this->request->post('order_id'); + $pay_type = $this->request->post('pay_type'); $auth_code = $this->request->post('auth_code'); //微信支付条码 if ($auth_code == '' && $pay_type != PayEnum::CASH_PAY) { return $this->fail('支付条码不能为空'); } $params = $this->request->post(); $where = [ - 'id' => $order_id, + 'order_id' => $order_id, 'paid' => 0, ]; $order = StoreOrder::where($where)->find();