wesmiler 2 miesięcy temu
rodzic
commit
52e2b78bd1
1 zmienionych plików z 4 dodań i 9 usunięć
  1. 4 9
      app/Services/Api/OrderService.php

+ 4 - 9
app/Services/Api/OrderService.php

@@ -185,11 +185,9 @@ class OrderService extends BaseService
     public function createOrder($userId, $params)
     {
         try {
-            $submitType = isset($params['type']) && $params['type'] ? $params['type'] : '';
             $addressId = isset($params['address_id']) && $params['address_id'] ? $params['address_id'] : 0;
             $goods = isset($params['goods']) && $params['goods'] ? $params['goods'] : [];
             $ids = $goods ? array_column($goods, 'id') : [];
-            $skuIds = $goods ? array_column($goods, 'sku_id') : [];
             // 参数验证
             if (empty($goods) || empty($ids)) {
                 $this->error = '商品参数不为空';
@@ -288,9 +286,6 @@ class OrderService extends BaseService
                 $discountTotal = moneyFormat($total - $orderTotal,2);
             }
 
-            // 邮费
-            $total = moneyFormat($total + $deliveryFee,2);
-
             if (env('PAY_DEBUG')) {
                 $orderTotal = 0.1;
             }
@@ -301,12 +296,12 @@ class OrderService extends BaseService
                 'order_no' => $orderNo,
                 'user_id' => $userId,
                 'store_id' => $storeId,
-                'total' => $total,
+                'total' => $total, // 商品总价
                 'num' => $orderCount,
-                'pay_total' => $orderTotal,
+                'pay_total' => $orderTotal, // 折扣后商品总价
                 'discount_point' => $discountPoint,
-                'discount_total' => $discountTotal,
-                'delivery_fee' => $deliveryFee,
+                'discount_total' => $discountTotal, // 折扣金额
+                'delivery_fee' => $deliveryFee, // 运费
                 'receiver_name' => $realname,
                 'receiver_mobile' => $mobile,
                 'receiver_area' => $area,