Sfoglia il codice sorgente

非自取订单考虑配送问题

shish 4 anni fa
parent
commit
dd57110913

+ 1 - 1
app-mall/controllers/OrderController.php

@@ -145,7 +145,7 @@ class OrderController extends BaseController
             $post['discountType'] = $discountData['discountType'];
             $post['discountAmount'] = $discountData['discountAmount'];
 
-            //自取订单不用考虑配送时间
+            //自取订单考虑配送时间
             $sendType = $post['sendType'] ?? 0;
             if ($sendType != 1) {
                 $post['reachDate'] = isset($post['reachDate']) && !empty($post['reachDate']) ? $post['reachDate'] : date("Y-m-d");

+ 10 - 0
biz-hd/order/services/OrderService.php

@@ -295,6 +295,16 @@ class OrderService extends BaseService
             $data['onlinePay'] = dict::getDict('onlinePay', 'not');
         }
 
+        //非自取订单考虑配送时间
+        $sendType = $post['sendType'] ?? 0;
+        if ($sendType != 1) {
+            $post['reachDate'] = isset($post['reachDate']) && !empty($post['reachDate']) ? $post['reachDate'] : date("Y-m-d");
+            if (isset($post['reachPeriod']) == false || empty($post['reachPeriod'])) {
+                util::fail('请选择配送时间');
+            }
+            $post['reachTime'] = strtotime($post['reachDate'] . ' ' . $post['reachPeriod']);
+        }
+
         //保存订单
         $returnOrder = OrderClass::addOrder($data);