rabin 2 år sedan
förälder
incheckning
d145dc35e8

+ 1 - 1
app/cash/lib/Set.php

@@ -376,7 +376,7 @@ class Set
         $data = $this->getOrderData($type, $info);
 
         $stat_type = Dever::db('cash/shop')->config['config_type'];
-        $other = Dever::db($type . '/info')->find($id);
+        $other = Dever::db($type . '/info')->find($info[$type . '_id']);
         $status = $config['config_status'][$info['status']];
         $other_status = $config['config_status'][$info[$type . '_status']];
 

+ 16 - 0
service/agent/database/member.php

@@ -26,6 +26,12 @@ $type = array
     2 => '公司',
 );
 
+$prize_type = array
+(
+    1 => '名额外',
+    2 => '名额内',
+);
+
 $is_shop = array
 (
     1 => '无法修改',
@@ -532,6 +538,16 @@ return array
             'update'    => 'radio',
         ),
 
+        'prize_type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '是否名额内',
+            'default'   => '1',
+            'desc'      => '是否名额内',
+            'match'     => 'is_numeric',
+            'option'    => $prize_type,
+        ),
+
         'state'     => array
         (
             'type'      => 'tinyint-1',

+ 5 - 0
service/agent/lib/Manage.php

@@ -667,6 +667,11 @@ class Manage
             $param = explode(',', $param);
             foreach ($param as $k => $v) {
                 $t = Dever::array_decode($v);
+
+                # 判断是否名额内
+                if (isset($t['prize_type']) && $t['prize_type'] == 2) {
+                    Dever::db('agent/member')->update(array('where_id' => $order['mid'], 'prize_type' => $t['prize_type']));
+                }
                 $parent_order = $order;
                 $parent_order['mid'] = $t['parent_mid'];
                 $where['type'] = $t['type'];

+ 2 - 1
service/agent/lib/Order.php

@@ -1100,8 +1100,9 @@ class Order
                                 if ($parent_prize && $parent_prize['type'] == 2 && $parent_prize['role'] == $role['id']) {
                                     $reward['value'] = $parent_prize['per'];
                                     $param['parent_goods_id'] = $vg['id'];
+                                    $param['prize_type'] = 2;
 
-                                    # 检测有没有名额权益 待加
+                                    # 检测有没有名额权益
                                     $prize_goods = Dever::db('setting/prize_goods')->select(array('prize_id' => $parent_prize['id']));
                                     if ($prize_goods) {
                                         foreach ($prize_goods as $pk => $pv) {

+ 7 - 1
service/option/database/agreement.php

@@ -36,6 +36,8 @@ if ($aid) {
         // '返回上一页' => array('location', 'l=project/database/list&project=option&table=cash&page_type=1&aid=' . $option_aid),
     );
 }
+
+$mul = '{audit} == 2';
 return array
 (
     # 表名
@@ -76,7 +78,7 @@ return array
             'desc'      => '代理商',
             'match'     => 'is_string',
             'update'    => 'text',
-            'search'    => array
+            'searchs'    => array
             (
                 'api' => 'option/account-find',
                 'col' => 'mobile',
@@ -175,6 +177,7 @@ return array
             'desc'      => '姓名',
             'match'     => 'is_string',
             'update'    => 'text',
+            'search'    => $aid ? 'hidden' : 'fulltext',
         ),
 
         'mobile'      => array
@@ -307,6 +310,8 @@ return array
             'control'   => 'audit',
             'value'     => $col ? '3' : '1',
             'list'      => true,
+            'mul'       => true,
+            'mul_option' => $audit_manage,
             'list_order' => 7,
             'control'   => 'audit',
         ),
@@ -385,6 +390,7 @@ return array
         'delete' => false,
         'edit' => false,
         'button' => $button,
+        'mul' => $mul,
         'list_button' => array
         (
             'new' => array('查看', '"lib/agreement.location?id={id}"', 'option'),

+ 6 - 0
service/option/lib/Cash.php

@@ -244,6 +244,12 @@ class Cash
 
     # 确认期权价值
     public function setValue_commit($info)
+    {
+        $this->setValue_act($info);
+    }
+
+    # 确认期权价值
+    public function setValue_act($info)
     {
         $account_cash = Dever::db('option/cash')->select(array('aid' => $info['aid']));
         if ($account_cash) {

+ 25 - 14
service/option/lib/Manage.php

@@ -85,27 +85,38 @@ class Manage
         $update = array();
         $audit = Dever::param('audit', $data);
         $desc = Dever::param('audit_desc', $data);
-        $info = Dever::db('option/agreement')->one($id);
-        if ($audit > 1 && $info) {
+        if ($audit > 1) {
             $admin = Dever::load('manage/auth.info');
             $update['audit_date'] = time();
             $update['audit_admin'] = $admin['id'];
             if ($audit == 3) {
                 $update['status'] = 2;
             }
-            
-            $update['where_id'] = $info['id'];
-            $state = Dever::db('option/agreement')->update($update);
-            if ($state && $audit == 3) {
-                Dever::load('option/lib/cash.setValue_commit', $info);
+
+            $mul_type = Dever::config('base')->mul_type;
+            if ($mul_type == 2) {
+                $list = Dever::db('option/agreement')->select(array('status' => 2));
+            } else {
+                $list = explode(',', $id);
             }
-            if ($audit == 3) {
-                if (Dever::project('sms')) {
-                    Dever::load('sms/api')->send('qiquan_audit', $info['mobile'], array('name' => $info['name']));
-                }
-            } elseif ($audit == 4) {
-                if (Dever::project('sms')) {
-                    Dever::load('sms/api')->send('qiquan_audit', $info['mobile'], array('name' => $info['name'], 'content' => $desc));
+
+            foreach ($list as $k => $v) {
+                $info = Dever::db('option/agreement')->one($v);
+                if ($info) {
+                    $update['where_id'] = $info['id'];
+                    $state = Dever::db('option/agreement')->update($update);
+                    if ($state && $audit == 3) {
+                        Dever::load('option/lib/cash.setValue_act', $info);
+                    }
+                    if ($audit == 3) {
+                        if (Dever::project('sms')) {
+                            Dever::load('sms/api')->send('qiquan_audit', $info['mobile'], array('name' => $info['name']));
+                        }
+                    } elseif ($audit == 4) {
+                        if (Dever::project('sms')) {
+                            Dever::load('sms/api')->send('qiquan_audit', $info['mobile'], array('name' => $info['name'], 'content' => $desc));
+                        }
+                    }
                 }
             }
         }