rabin 3 年之前
父節點
當前提交
7aa7807fcf
共有 3 個文件被更改,包括 25 次插入3 次删除
  1. 2 2
      app/shop/database/sell_order.php
  2. 15 1
      app/shop/lib/Manage.php
  3. 8 0
      app/shop/lib/Sell.php

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

@@ -137,7 +137,7 @@ return array
     (
         'insert' => 'shop/lib/manage.sellOrderUpdate',
         'update' => 'shop/lib/manage.sellOrderUpdate',
-        'updatemul' => 'shop/lib/manage.setSellOrderStatusMul',
+        'updatemul' => 'shop/lib/manage.setSellOrderStatusMul_commit',
     ),
     # 数据结构
     'struct' => array
@@ -596,7 +596,7 @@ return array
             'list'      => true,
             'list_order' => 14,
             'mul'   => true,
-            'mul_option' => array(5 => '确认收货'),
+            'mul_option' => array(2 => '批量审核', 5 => '确认收货'),
         ),
 
         'audit'        => array

+ 15 - 1
app/shop/lib/Manage.php

@@ -319,11 +319,12 @@ class Manage
         }
     }
 
-    public function setSellOrderStatusMul($id, $name, $data)
+    public function setSellOrderStatusMul_commit($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) {
@@ -338,6 +339,19 @@ class Manage
                     Dever::load('shop/lib/sell')->finish($info, $info['shop_id']);
                 }
             }
+        } elseif ($status == 2) {
+            # 批量审核
+            $list = explode(',', $id);
+            if ($list) {
+                foreach ($list as $k => $v) {
+                    if (is_array($v)) {
+                        $id = $v['id'];
+                    } else {
+                        $id = $v;
+                    }
+                    Dever::load('shop/lib/sell')->auditOne($id);
+                }
+            }
         }
     }
 

+ 8 - 0
app/shop/lib/Sell.php

@@ -2208,6 +2208,14 @@ class Sell
     public function audit_commit()
     {
         $order_id = Dever::input('order_id');
+        $this->auditOne($order_id);
+
+        return 'ok';
+    }
+
+    # 采购订单审核 拆单
+    public function auditOne($order_id)
+    {
         $order = Dever::db('shop/sell_order')->find($order_id);
 
         if (!$order || ($order && $order['status'] != 2)) {