dever 3 lat temu
rodzic
commit
54e4361314

+ 7 - 1
app/mshop/lib/Buy.php

@@ -313,6 +313,7 @@ class Buy
         print_r($factory);die;
         print_r($factory);die;
 
 
         if ($store) {
         if ($store) {
+            $num = 0;
             foreach ($goods as $k => $v) {
             foreach ($goods as $k => $v) {
                 # 开始找仓库
                 # 开始找仓库
                 $find = $this->store($order_id, $shop, $store, $v);
                 $find = $this->store($order_id, $shop, $store, $v);
@@ -330,11 +331,16 @@ class Buy
                 }
                 }
 
 
                 if ($find[1]) {
                 if ($find[1]) {
+                    $num++;
                     Dever::db('shop/buy_order_goods')->update(array('where_id' => $v['id'], 'status' => 2, 'type' => $find[0], 'type_id' => implode(',', $find[1])));
                     Dever::db('shop/buy_order_goods')->update(array('where_id' => $v['id'], 'status' => 2, 'type' => $find[0], 'type_id' => implode(',', $find[1])));
                 }
                 }
             }
             }
 
 
-            Dever::db('shop/buy_order')->update(array('where_id' => $info['id'], 'status' => 3));
+            if ($num > 0) {
+                Dever::db('shop/buy_order')->update(array('where_id' => $info['id'], 'status' => 3));
+            } else {
+                Dever::db('shop/buy_order')->update(array('where_id' => $info['id'], 'status' => 7));
+            }
         }
         }
     }
     }
 
 

+ 3 - 2
app/shop/database/buy_order.php

@@ -9,8 +9,9 @@ $status = array
     3 => '待发货',
     3 => '待发货',
     4 => '待收货确认',
     4 => '待收货确认',
     5 => '已完成',
     5 => '已完成',
-    6 => '已完成(有退款)',
-    7 => '已取消',
+    6 => '退款退货',
+    7 => '无货退款',
+    8 => '已取消',
 );
 );
 
 
 return array
 return array

+ 2 - 2
app/shop/database/buy_order_goods.php

@@ -2,8 +2,8 @@
 
 
 $status = array
 $status = array
 (
 (
-    1 => '待下单',
-    2 => '已下单',
+    1 => '待分配',
+    2 => '已分配',
     3 => '已完成',
     3 => '已完成',
     4 => '缺货',
     4 => '缺货',
     5 => '门店退款',
     5 => '门店退款',