rabin 3 years ago
parent
commit
d25ef5f8bf
2 changed files with 27 additions and 2 deletions
  1. 3 2
      app/shop/database/sell_order.php
  2. 24 0
      app/shop/lib/Manage.php

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

@@ -117,9 +117,9 @@ if ($search_option_shop_type == 1) {
 }
 $mul = false;
 if (Dever::load('manage/auth')->checkFunc('menu_61.menu_85', 'piliangfafang', '批量收货')) {
-    $mul = '{status} == 4';
+    $mul = '{status} == 4 && {shop_type} == 2';
 } elseif (Dever::load('manage/auth')->checkFunc('menu_61.menu_218', 'piliangfafang', '批量收货')) {
-    $mul = '{status} == 4';
+    $mul = '{status} == 4 && {shop_type} == 2';
 }
 return array
 (
@@ -137,6 +137,7 @@ return array
     (
         'insert' => 'shop/lib/manage.sellOrderUpdate',
         'update' => 'shop/lib/manage.sellOrderUpdate',
+        'updatemul' => 'shop/lib/manage.setSellOrderStatusMul',
     ),
     # 数据结构
     'struct' => array

+ 24 - 0
app/shop/lib/Manage.php

@@ -263,6 +263,30 @@ class Manage
         }
     }
 
+    public function setSellOrderStatusMul($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $status = Dever::param('status', $data);
+        if ($status == 5) {
+            $list = explode(',', $id);
+            if ($list) {
+                foreach ($list as $k => $v) {
+                    if (is_array($v)) {
+                        $id = $v['id'];
+                        $info = Dever::db('shop/sell_order')->one($id);
+                    } else {
+                        $id = $v;
+                        $info = Dever::db('shop/sell_order')->one($id);
+                    }
+                    if ($info['status'] != 4) {
+                        continue;
+                    }
+                    Dever::load('shop/lib/sell')->finish($info, $info['shop_id']);
+                }
+            }
+        }
+    }
+
     /**
      * 更新信息
      *