123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?php
- namespace Agent\Lib;
- use Dever;
- class User
- {
- /**
- * 查看详情
- * @return mixed
- */
- public function show()
- {
- $id = Dever::input('id');
- $info = Dever::db('agent/user_bind')->one($id);
- $status = Dever::db('agent/user_bind')->config['status'];
- $audit_date='';
- if (isset($info['aduit_date']) && $info['aduit_date']) {
- $audit_date = date('Y-m-d H:i', $info['audit_date']);
- } else {
- $audit_date = date('Y-m-d H:i',$info['cdate']);
- }
- if ($info['admin'] && $info['admin'] > 0) {
- $admin_name = Dever::load("manage/admin-find#username", $info['admin']);
- } else {
- $admin_name = '';
- }
-
- /*
- $idcard_pic = '<a href="'.$info['idcard_front'].'" target="_blank"><img src="'.$info['idcard_front'].'" width="150" /></a>';
- if ($info['idcard_back']) {
- $idcard_pic .= ' <a href="'.$info['idcard_back'].'" target="_blank"><img src="'.$info['idcard_back'].'" width="150" /></a>';
- }
- $result['小程序账号'] = array
- (
- 'type' => 'info',
- 'content' => array
- (
- array
- (
- array('手机号', $info['mobile']),
- array('姓名', $info['name']),
- array('身份证号', $info['idcard']),
- ),
- array
- (
- array('身份证照片', $idcard_pic),
- ),
- ),
- );
- */
- $user = Dever::db('passport/user')->find($info['uid']);
- $result['审核信息'] = array
- (
- 'type' => 'user',
- 'content' => array
- (
- array('状态', $status[$info['status']]),
- array('时间', $audit_date),
- array('审核人',$admin_name),
- array('审核备注', $info['audit_desc']),
- ),
- );
- $result['小程序账号'] = array
- (
- 'type' => 'user',
- 'content' => array
- (
- //array('手机号', $user['mobile']),
- array('昵称', $user['username']),
- array('身份证号', $info['idcard']),
- ),
- );
- $member = Dever::db('agent/member')->find($info['mid']);
- if ($member) {
- $where['id'] = $member['id'];
- $where['idcard'] = $member['idcard'];
- $where['status'] = '1,2';
- //$other = Dever::db('agent/member')->getData($where);
- $other = false;
- $idcard_pic = '<a href="'.$member['idcard_front'].'" target="_blank"><img src="'.$member['idcard_front'].'" width="150" /></a>';
- if ($member['idcard_back']) {
- $idcard_pic .= ' <a href="'.$member['idcard_back'].'" target="_blank"><img src="'.$member['idcard_back'].'" width="150" /></a>';
- }
- $role = Dever::db('setting/role')->find($member['role']);
- $result['代理商账号:' . $member['name']] = array
- (
- 'type' => 'user',
- 'content' => array
- (
- array('姓名', $member['name']),
- array('手机号', $member['mobile']),
- array('角色', $role['name']),
- array('身份证号', $member['idcard']),
- array('身份证照片', $idcard_pic),
- ),
- );
- if ($other) {
- foreach ($other as $k => $v) {
- $role = Dever::db('setting/role')->find($v['role']);
- $idcard_pic = '<a href="'.$v['idcard_front'].'" target="_blank"><img src="'.$v['idcard_front'].'" width="150" /></a>';
- if ($v['idcard_back']) {
- $idcard_pic .= ' <a href="'.$v['idcard_back'].'" target="_blank"><img src="'.$v['idcard_back'].'" width="150" /></a>';
- }
- $result['代理商账号:' . $v['name']] = array
- (
- 'type' => 'user',
- 'content' => array
- (
- array('姓名', $v['name']),
- array('手机号', $v['mobile']),
- array('角色', $role['name']),
- array('身份证号', $v['idcard']),
- array('身份证照片', $idcard_pic),
- ),
- );
- }
- }
- }
- $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' => '账号绑定',
- 'btn' => $head_btn,
- );
- $html = Dever::show($head, $result, false, false, 'dls-user-box');
- return $html;
- }
- public function setStatus_api()
- {
- $where['where_id'] = Dever::input('id');
- $where['status'] = Dever::input('value');
- Dever::db('agent/user_bind')->update($where);
- return 'reload';
- }
- }
|