dever преди 3 години
родител
ревизия
0d7524f529
променени са 2 файла, в които са добавени 13 реда и са изтрити 4 реда
  1. 5 0
      app/mshop/lib/Buy.php
  2. 8 4
      app/shop/lib/Manage.php

+ 5 - 0
app/mshop/lib/Buy.php

@@ -1560,6 +1560,7 @@ class Buy
                                     # 库存符合
                                     $data['2_' . $v['id']][] = array
                                     (
+                                        'area' => $shop['area'],
                                         'order_id' => $order['id'],
                                         'order_type' => $order['type'],
                                         'order_num' => $order['order_num'],
@@ -1616,6 +1617,7 @@ class Buy
                             if ($sku) {
                                 $data['3_' . $v['id']][] = array
                                 (
+                                    'area' => $shop['area'],
                                     'order_id' => $order['id'],
                                     'order_type' => $order['type'],
                                     'order_num' => $order['order_num'],
@@ -1809,6 +1811,9 @@ class Buy
 
         if (!$info) {
             $insert = $where;
+            if (isset($data['area'])) {
+                $insert['area'] = $data['area'] . ',' . $where['type_id'];
+            }
             $insert['name'] = $data['order_id'];
             $insert['order_num'] = $data['order_num'];
             $insert['operdate'] = time();

+ 8 - 4
app/shop/lib/Manage.php

@@ -308,10 +308,14 @@ class Manage
             }
             $gup['option_shop_id'] = $id;
             $gup['set_area'] = $area;
-            //Dever::db('shop/goods_sku')->updates($gup);
-            //Dever::db('shop/sell_order')->updates($gup);
-            //Dever::db('shop/buy_order')->updates($gup);
-            //Dever::db('shop/out_order')->updates($gup);
+            Dever::db('shop/goods_sku')->updates($gup);
+            Dever::db('shop/sell_order')->updates($gup);
+
+            unset($gup['option_shop_id']);
+            $gup['option_type_id'] = $id;
+            $gup['option_type'] = 1;
+            Dever::db('shop/buy_order')->updates($gup);
+            Dever::db('shop/out_order')->updates($gup);
         }
 
         $map = Dever::param('map', $data);