rabin 2 years ago
parent
commit
996b8efdf2
4 changed files with 112 additions and 29 deletions
  1. 9 1
      app/shop/src/My.php
  2. 64 6
      service/agent/database/user_bind.php
  3. 19 0
      service/agent/lib/Manage.php
  4. 20 22
      service/agent/lib/User.php

+ 9 - 1
app/shop/src/My.php

@@ -32,11 +32,14 @@ class My extends Core
 		$bind = Dever::db('agent/user_bind')->find(array('uid' => $this->uid));
 		if ($bind && $bind['status'] == 2 && $bind['mid']) {
 			$this->data['bind_status'] = $bind['status'];
+			$this->data['bind_desc'] = $bind['audit_desc'];
 			$this->data['agent'][] = Dever::load('agent/lib/member')->getInfo($bind['mid']);
 		} elseif ($bind && $bind['status'] != 2) {
 			$this->data['bind_status'] = $bind['status'];
+			$this->data['bind_desc'] = $bind['audit_desc'];
 		} else {
 			$this->data['bind_status'] = 0;
+			$this->data['bind_desc'] = '';
 		}
 
 		return $this->data;
@@ -277,7 +280,7 @@ class My extends Core
         if (!$data['mobile']) {
             Dever::alert('手机号不能为空');
         }
-        Dever::load('agent/lib/member')->checkMcode($data['mobile']);
+        //Dever::load('agent/lib/member')->checkMcode($data['mobile']);
 
         $member = Dever::db('agent/member')->find(array('mobile' => $data['mobile']));
         if (!$member) {
@@ -314,6 +317,11 @@ class My extends Core
         }
         */
 
+        $info = Dever::db('agent/user_bind')->find(array('mid' => $data['mid'], 'status' => 2));
+        if ($info) {
+        	Dever::alert('该代理商信息已绑定');
+        }
+
 		$info = Dever::db('agent/user_bind')->find(array('uid' => $this->uid));
 
 		if (!$info) {

+ 64 - 6
service/agent/database/user_bind.php

@@ -6,18 +6,31 @@ $status = array
     3 => '驳回',
 );
 
+$manage_audit = array
+(
+    //1 => '未核实',
+    2 => '已核实',
+    3 => '驳回',
+);
+
 $type = array
 (
     1 => '个人',
     2 => '公司',
 );
 
+$col = Dever::input('col');
+
 return array
 (
     # 表名
     'name' => 'user_bind',
     # 显示给用户看的名称
     'lang' => '零售绑定认证',
+    'end' => array
+    (
+        'update' => 'agent/lib/manage.updateUserBind',
+    ),
     'order' => 1,
     # 数据结构
     'struct' => array
@@ -75,8 +88,8 @@ return array
             'desc'      => '姓名',
             'match'     => 'is_string',
             'update'    => 'text',
-            'search'    => 'fulltext',
-            'list'      => true,
+            //'search'    => 'fulltext',
+            //'list'      => true,
             'list_order' => 4,
         ),
 
@@ -113,6 +126,7 @@ return array
             'desc'      => '身份证号码',
             'match'     => 'is_string',
             'update'    => 'text',
+            'search'    => 'fulltext',
             'list'		=> true,
             'list_order' => 5,
         ),
@@ -190,6 +204,51 @@ return array
             'list'      => true,
         ),
 
+        'audit'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '审核状态',
+            'default'   => '2',
+            'desc'      => '审核状态',
+            'match'     => 'is_numeric',
+            'update'    => $col ? 'radio' : false,
+            'option'    => $manage_audit,
+            'mul'       => true,
+            'control'   => 'audit',
+        ),
+
+        'audit_desc'      => array
+        (
+            'type'      => 'varchar-600',
+            'name'      => '备注',
+            'default'   => '',
+            'desc'      => '审核说明',
+            'match'     => 'is_string',
+            'update'    => $col ? 'textarea' : false,
+            // 'list'      => '"{audit_desc}" ? "{audit_desc}" : "-"',
+            // 'list_order'  => 9,
+            'show'      => 'audit=3',
+        ),
+
+        'audit_date'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '审核时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '审核时间',
+        ),
+
+        'admin'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '操作人',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '操作人',
+            //'list'      => '"{admin}" > 0 ? Dever::load("manage/admin-find#username", {admin}) : "-"',
+        ),
+
         'state'     => array
         (
             'type'      => 'tinyint-1',
@@ -222,12 +281,11 @@ return array
 
         'list_button' => array
         (
-        	'list' => array('绑定身份', '"user_bind&id={id}&page_type=1"', '{status} == 1'),
-
-            'list1' => array('关联查询', '"user_bind&id={id}&page_type=1"', '{status} == 2'),
+        	'list' => array('查看详情', '"user_bind&id={id}&page_type=1"'),
 
             //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
-            'delete' => array('删除关联', '', '{status} == 2'),
+            'edit' => array('审核', 'audit,audit_desc', '{status} == 1'),
+            //'delete' => array('删除关联', '', '{status} == 2'),
         ),
     ),
 

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

@@ -895,4 +895,23 @@ class Manage
         }
         return 'ok';
     }
+
+    public function updateUserBind($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $update = array();
+        $audit = Dever::param('audit', $data);
+        $desc = Dever::param('audit_desc', $data);
+        $info = Dever::db('agent/user_bind')->one($id);
+        if ($info) {
+            if ($audit) {
+                $update['where_id'] = $info['id'];
+                $update['audit_date'] = time();
+                $update['status'] = $audit;
+                $admin = Dever::load('manage/auth.info');
+                $update['admin'] = $admin['id'];
+                Dever::db('agent/user_bind')->update($update);
+            }
+        }
+    }
 }

+ 20 - 22
service/agent/lib/User.php

@@ -44,11 +44,12 @@ class User
         $user = Dever::db('passport/user')->find($info['uid']);
         $result['小程序账号'] = array
         (
-            'type' => 'info',
+            'type' => 'user',
             'content' => array
             (
                 array('手机号', $user['mobile']),
                 array('昵称', $user['username']),
+                array('身份证号', $info['idcard']),
             ),
         );
 
@@ -68,7 +69,7 @@ class User
 
         	$result['代理商账号:' . $member['name']] = array
 	        (
-	            'type' => 'info',
+	            'type' => 'user',
 	            'content' => array
 	            (
 	            	array('姓名', $member['name']),
@@ -89,7 +90,7 @@ class User
 
         			$result['代理商账号:' . $v['name']] = array
 			        (
-			            'type' => 'info',
+			            'type' => 'user',
 			            'content' => array
 			            (
 			                array('姓名', $v['name']),
@@ -103,35 +104,32 @@ class User
         	}
         }
 
-        $button = array();
-        if ($info['status'] == 1) {
-        	$button['btn'][] = array
-	        (
-	            'type' => 'action',
-	            'link' => Dever::url('lib/user.setStatus?id=' . $info['id'] . '&value=2', 'agent'),
-	            'name' => '对比核实通过',
-	        );
-	        $button['btn'][] = array
-	        (
-	            'type' => 'action',
-	            'link' => Dever::url('lib/user.setStatus?id=' . $info['id'] . '&value=3', 'agent'),
-	            'name' => '拒绝',
-	        );
-        }
+        $head_btn = array();
+        //Dever::url('lib/user.setStatus?id=' . $info['id'] . '&value=2', 'agent'),
+        //Dever::url('lib/user.setStatus?id=' . $info['id'] . '&value=3', 'agent'),
 
+        /*
         $head_btn[] = array
         (
             'type' => 'link',
             'link' => Dever::url('project/database/list?project=agent&table=user_bind&page_type=2', 'manage'),
             'name' => '返回上一页',
-        );
+        );*/
+
+        if ($info['status'] == 1) {
+            $head_btn[] = array
+            (
+                'type' => 'edit',
+                'link' => Dever::url('project/database/update?project=agent&table=user_bind&where_id='.$id.'&col=audit,audit_desc', 'manage'),
+                'name' => '审核',
+            );
+        }
         $head = array
         (
-            'name' => '零售账号绑定',
+            'name' => '账号绑定',
             'btn' => $head_btn,
         );
-        $foot = $button;
-        $html = Dever::show($head, $result, $foot);
+        $html = Dever::show($head, $result, false, false, false, 'dls-user-box');
 
         return $html;
     }