Kirin 2 years ago
parent
commit
b5398cd4c7

+ 0 - 1
app/admin/controller/store/Placeorder.php

@@ -122,7 +122,6 @@ class Placeorder extends AuthController
             $product = \app\admin\model\store\StoreProduct::get($info['product_id']);
             $product = \app\admin\model\store\StoreProduct::get($info['product_id']);
             $discounts = json_decode($product['time_area_discount'] ?: '[]', true);
             $discounts = json_decode($product['time_area_discount'] ?: '[]', true);
             $discount = 0;
             $discount = 0;
-            var_dump($discounts);
             if (count($discounts) > 0) {
             if (count($discounts) > 0) {
                 foreach ($discounts as $kk => $v) {
                 foreach ($discounts as $kk => $v) {
                     $times = explode('-', $kk);
                     $times = explode('-', $kk);

+ 1 - 1
app/admin/controller/store/StoreProduct.php

@@ -333,7 +333,7 @@ class StoreProduct extends AuthController
             if (strtotime(date('Y-m-d') . ' ' . ($v['start'] ?? '00:00')) >= strtotime(date('Y-m-d') . ' ' . ($v['end'] ?? '00:00'))) {
             if (strtotime(date('Y-m-d') . ' ' . ($v['start'] ?? '00:00')) >= strtotime(date('Y-m-d') . ' ' . ($v['end'] ?? '00:00'))) {
                 return Json::fail('区间折扣的开始时间需要小于结束时间');
                 return Json::fail('区间折扣的开始时间需要小于结束时间');
             }
             }
-            $data['time_area_discount'][] = [$v['start'] . '-' . $v['end'] => $v['value']];
+            $data['time_area_discount'][$v['start'] . '-' . $v['end']] = $v['value'];
         }
         }
         $data['time_area_discount'] = json_encode($data['time_area_discount']);
         $data['time_area_discount'] = json_encode($data['time_area_discount']);
         unset($data['selectTime']);
         unset($data['selectTime']);