rabin 3 years ago
parent
commit
0278cb5a2c
2 changed files with 27 additions and 0 deletions
  1. 4 0
      app/cash/database/shop.php
  2. 23 0
      app/cash/lib/Set.php

+ 4 - 0
app/cash/database/shop.php

@@ -24,6 +24,8 @@ $shop = function()
 	return $array;
 };
 
+$mul = false;
+$mul = '{status} == 1';
 return array
 (
     # 表名
@@ -33,6 +35,7 @@ return array
     'order' => 90,
     'config_status' => $status,
     'config_type' => $type,
+    'updatemul' => 'cash/lib/set.auditShopMul',
     # 数据结构
     'struct' => array
     (
@@ -180,6 +183,7 @@ return array
         'edit' => false,
         'insert' => false,
         'excel'	=> true,
+        'mul' => $mul,
 
         'list_button' => array(
 

+ 23 - 0
app/cash/lib/Set.php

@@ -93,6 +93,7 @@ class Set
     # 审核对账
     public function audit_api()
     {
+        Dever::config('base')->hook = true;
         $id = Dever::input('id');
         $type = Dever::input('type', 'shop');
         $table = 'cash/' . $type;
@@ -126,6 +127,28 @@ class Set
         return 'reload';
     }
 
+    # 批量审核对账
+    public function auditShopMul($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $table = 'cash/shop';
+
+        if ($id) {
+            $list = explode(',', $id);
+            if ($list) {
+                foreach ($list as $k => $v) {
+                    $data = Dever::db($table)->one($v);
+            
+                    if ($data) {
+                        Dever::db($table)->update(array('where_id' => $v, 'status' => 2));
+                    }
+                }
+            }
+        }
+
+        return 'reload';
+    }
+
     # 审核对账
     public function audit_other_api()
     {