User.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\admin\controller;
  3. use think\Validate;
  4. use think\Lang;
  5. class User extends AdminControl
  6. {
  7. public function _initialize()
  8. {
  9. parent::_initialize();
  10. Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/member.lang.php');
  11. }
  12. /**
  13. * 用户列表
  14. * @return mixed
  15. */
  16. public function index()
  17. {
  18. $model_user = Model('User');
  19. $title = input('post.title');
  20. $time = input('post.timeRang');
  21. if(!empty($time)){
  22. $gap = explode(' - ', $time);
  23. $begin = strtotime($gap[0]);
  24. $end = strtotime($gap[1]);
  25. }
  26. $condition = array();
  27. if($title){
  28. $condition['user_email|user_phone'] = $title;
  29. }
  30. if($time && $begin && $end){
  31. $condition['user_addTime'] = array('between', array($begin, $end));
  32. }
  33. $user_list = $model_user->getUserList($condition, '*', 10);
  34. for($i=0;$i<count($user_list);$i++){
  35. $user_list[$i]['user_addTime'] = date("Y-m-d H:i:s",$user_list[$i]['user_addTime']);
  36. if($user_list[$i]['user_status'] == -1){
  37. $user_list[$i]['user_status'] = '未实名认证';
  38. }
  39. if($user_list[$i]['user_status'] == 2){
  40. $user_list[$i]['user_status'] = '实名认证中';
  41. }
  42. if($user_list[$i]['user_status'] == 1){
  43. $user_list[$i]['user_status'] = '已实名认证';
  44. }
  45. if($user_list[$i]['user_type'] == 1){
  46. $user_list[$i]['user_type'] = '个人用户';
  47. }
  48. if($user_list[$i]['user_type'] == 2){
  49. $user_list[$i]['user_type'] = '企业用户';
  50. }
  51. }
  52. $allpower = $this->qxhans();
  53. $this->assign('allpower',$allpower);
  54. $this->assign('user_list', $user_list);
  55. $this->assign('show_page', $model_user->page_info->render());
  56. $this->setAdminCurItem('index');
  57. return $this->fetch();
  58. }
  59. }