From 73ff0a9ae8f386509572df6727fd5a4f99fad26e Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 8 Jun 2024 19:56:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E5=A4=84=E7=90=86=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 1 + app/common/logic/store_order/StoreOrderLogic.php | 5 ++++- app/store/controller/store_order/StoreOrderController.php | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) 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();