User.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php
  2. namespace Agent\Lib;
  3. use Dever;
  4. class User
  5. {
  6. /**
  7. * 查看详情
  8. * @return mixed
  9. */
  10. public function show()
  11. {
  12. $id = Dever::input('id');
  13. $info = Dever::db('agent/user_bind')->one($id);
  14. $status = Dever::db('agent/user_bind')->config['status'];
  15. $audit_date='';
  16. if (isset($info['aduit_date']) && $info['aduit_date']) {
  17. $audit_date = date('Y-m-d H:i', $info['audit_date']);
  18. } else {
  19. $audit_date = date('Y-m-d H:i',$info['cdate']);
  20. }
  21. if ($info['admin'] && $info['admin'] > 0) {
  22. $admin_name = Dever::load("manage/admin-find#username", $info['admin']);
  23. } else {
  24. $admin_name = '';
  25. }
  26. /*
  27. $idcard_pic = '<a href="'.$info['idcard_front'].'" target="_blank"><img src="'.$info['idcard_front'].'" width="150" /></a>';
  28. if ($info['idcard_back']) {
  29. $idcard_pic .= '&nbsp;&nbsp;<a href="'.$info['idcard_back'].'" target="_blank"><img src="'.$info['idcard_back'].'" width="150" /></a>';
  30. }
  31. $result['小程序账号'] = array
  32. (
  33. 'type' => 'info',
  34. 'content' => array
  35. (
  36. array
  37. (
  38. array('手机号', $info['mobile']),
  39. array('姓名', $info['name']),
  40. array('身份证号', $info['idcard']),
  41. ),
  42. array
  43. (
  44. array('身份证照片', $idcard_pic),
  45. ),
  46. ),
  47. );
  48. */
  49. $user = Dever::db('passport/user')->find($info['uid']);
  50. $result['审核信息'] = array
  51. (
  52. 'type' => 'user',
  53. 'content' => array
  54. (
  55. array('状态', $status[$info['status']]),
  56. array('时间', $audit_date),
  57. array('审核人',$admin_name),
  58. array('审核备注', $info['audit_desc']),
  59. ),
  60. );
  61. $result['小程序账号'] = array
  62. (
  63. 'type' => 'user',
  64. 'content' => array
  65. (
  66. //array('手机号', $user['mobile']),
  67. array('昵称', $user['username']),
  68. array('身份证号', $info['idcard']),
  69. ),
  70. );
  71. $member = Dever::db('agent/member')->find($info['mid']);
  72. if ($member) {
  73. $where['id'] = $member['id'];
  74. $where['idcard'] = $member['idcard'];
  75. $where['status'] = '1,2';
  76. //$other = Dever::db('agent/member')->getData($where);
  77. $other = false;
  78. $idcard_pic = '<a href="'.$member['idcard_front'].'" target="_blank"><img src="'.$member['idcard_front'].'" width="150" /></a>';
  79. if ($member['idcard_back']) {
  80. $idcard_pic .= '&nbsp;&nbsp;<a href="'.$member['idcard_back'].'" target="_blank"><img src="'.$member['idcard_back'].'" width="150" /></a>';
  81. }
  82. $role = Dever::db('setting/role')->find($member['role']);
  83. $result['代理商账号:' . $member['name']] = array
  84. (
  85. 'type' => 'user',
  86. 'content' => array
  87. (
  88. array('姓名', $member['name']),
  89. array('手机号', $member['mobile']),
  90. array('角色', $role['name']),
  91. array('身份证号', $member['idcard']),
  92. array('身份证照片', $idcard_pic),
  93. ),
  94. );
  95. if ($other) {
  96. foreach ($other as $k => $v) {
  97. $role = Dever::db('setting/role')->find($v['role']);
  98. $idcard_pic = '<a href="'.$v['idcard_front'].'" target="_blank"><img src="'.$v['idcard_front'].'" width="150" /></a>';
  99. if ($v['idcard_back']) {
  100. $idcard_pic .= '&nbsp;&nbsp;<a href="'.$v['idcard_back'].'" target="_blank"><img src="'.$v['idcard_back'].'" width="150" /></a>';
  101. }
  102. $result['代理商账号:' . $v['name']] = array
  103. (
  104. 'type' => 'user',
  105. 'content' => array
  106. (
  107. array('姓名', $v['name']),
  108. array('手机号', $v['mobile']),
  109. array('角色', $role['name']),
  110. array('身份证号', $v['idcard']),
  111. array('身份证照片', $idcard_pic),
  112. ),
  113. );
  114. }
  115. }
  116. }
  117. $head_btn = array();
  118. //Dever::url('lib/user.setStatus?id=' . $info['id'] . '&value=2', 'agent'),
  119. //Dever::url('lib/user.setStatus?id=' . $info['id'] . '&value=3', 'agent'),
  120. /*
  121. $head_btn[] = array
  122. (
  123. 'type' => 'link',
  124. 'link' => Dever::url('project/database/list?project=agent&table=user_bind&page_type=2', 'manage'),
  125. 'name' => '返回上一页',
  126. );*/
  127. if ($info['status'] == 1) {
  128. $head_btn[] = array
  129. (
  130. 'type' => 'edit',
  131. 'link' => Dever::url('project/database/update?project=agent&table=user_bind&where_id='.$id.'&col=audit,audit_desc', 'manage'),
  132. 'name' => '审核',
  133. );
  134. }
  135. $head = array
  136. (
  137. 'name' => '账号绑定',
  138. 'btn' => $head_btn,
  139. );
  140. $html = Dever::show($head, $result, false, false, 'dls-user-box');
  141. return $html;
  142. }
  143. public function setStatus_api()
  144. {
  145. $where['where_id'] = Dever::input('id');
  146. $where['status'] = Dever::input('value');
  147. Dever::db('agent/user_bind')->update($where);
  148. return 'reload';
  149. }
  150. }