| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace app\admin\controller;
- use think\Validate;
- use think\Lang;
- class User extends AdminControl
- {
- public function _initialize()
- {
- parent::_initialize();
- Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/member.lang.php');
- }
- /**
- * 用户列表
- * @return mixed
- */
- public function index()
- {
- $model_user = Model('User');
- $title = input('post.title');
- $time = input('post.timeRang');
- if(!empty($time)){
- $gap = explode(' - ', $time);
- $begin = strtotime($gap[0]);
- $end = strtotime($gap[1]);
- }
- $condition = array();
- if($title){
- $condition['user_email|user_phone'] = $title;
- }
- if($time && $begin && $end){
- $condition['user_addTime'] = array('between', array($begin, $end));
- }
- $user_list = $model_user->getUserList($condition, '*', 10);
- for($i=0;$i<count($user_list);$i++){
- $user_list[$i]['user_addTime'] = date("Y-m-d H:i:s",$user_list[$i]['user_addTime']);
- if($user_list[$i]['user_status'] == -1){
- $user_list[$i]['user_status'] = '未实名认证';
- }
- if($user_list[$i]['user_status'] == 2){
- $user_list[$i]['user_status'] = '实名认证中';
- }
- if($user_list[$i]['user_status'] == 1){
- $user_list[$i]['user_status'] = '已实名认证';
- }
- if($user_list[$i]['user_type'] == 1){
- $user_list[$i]['user_type'] = '个人用户';
- }
- if($user_list[$i]['user_type'] == 2){
- $user_list[$i]['user_type'] = '企业用户';
- }
- }
- $allpower = $this->qxhans();
- $this->assign('allpower',$allpower);
- $this->assign('user_list', $user_list);
- $this->assign('show_page', $model_user->page_info->render());
- $this->setAdminCurItem('index');
- return $this->fetch();
- }
- }
|