lizhen_gitee il y a 1 an
Parent
commit
14facdf0df

+ 16 - 384
application/admin/controller/user/User.php

@@ -2,16 +2,7 @@
 
 namespace app\admin\controller\user;
 
-use app\admin\model\Message;
-use app\admin\model\UserPower;
 use app\common\controller\Backend;
-use app\common\library\Auth;
-use app\common\service\TenimService;
-use fast\Random;
-use think\Db;
-use think\Exception;
-use think\exception\PDOException;
-use think\exception\ValidateException;
 
 /**
  * 会员管理
@@ -20,11 +11,9 @@ use think\exception\ValidateException;
  */
 class User extends Backend
 {
-
-    protected $relationSearch = true;
-    protected $searchFields = 'u_id,username,nickname';
-
+    
     /**
+     * User模型对象
      * @var \app\admin\model\User
      */
     protected $model = null;
@@ -32,383 +21,26 @@ class User extends Backend
     public function _initialize()
     {
         parent::_initialize();
-        $this->model = model('User');
-        $typeList = [
-            'genderList' => $this->model->getGenderList(),
-            'isCoolList' => $this->model->getIsCoolList(),
-            'isManagerList' => $this->model->getIsManagerList(),
-            'isStealthList' => $this->model->getIsStealthList(),
-            'statusList' => $this->model->getStatusList(),
-            'needCheckList' => $this->model->getNeedCheckList(),
-        ];
-        $this->view->assign($typeList);
-    }
-
-    /**
-     * 查看
-     */
-    public function index()
-    {
-        $this->relationSearch = true;
-        //设置过滤方法
-        $this->request->filter(['strip_tags', 'trim']);
-        if ($this->request->isAjax()) {
-            //如果发送的来源是Selectpage,则转发到Selectpage
-            if ($this->request->request('keyField')) {
-                return $this->selectpage();
-            }
-            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-            $list = $this->model
-                ->with(['noble','preuser','auth','age','userwallet'])
-                ->where($where)
-                ->order($sort, $order)
-                ->paginate($limit);
-            foreach ($list as $k => $v) {
-                $v->avatar = $v->avatar ? cdnurl($v->avatar, true) : letter_avatar($v->nickname);
-                $v->hidden(['password', 'salt']);
-                $v->getRelation('age')->visible(['name']);
-                $v->getRelation('userwallet')->visible(['money','jewel']);
-            }
-            $result = array("total" => $list->total(), "rows" => $list->items());
-
-            return json($result);
-        }
-        return $this->view->fetch();
-    }
-
-    /**
-     * 添加
-     */
-    /**
-     * 添加
-     */
-    public function add()
-    {
-        if ($this->request->isPost()) {
-            $params = $this->request->post("row/a");
-            $params = $this->preExcludeFields($params);
-            if (!$params) {
-                $this->error(__('Parameter %s can not be empty', ''));
-            }
-            $result = false;
-            Db::startTrans();
-            try {
-                //是否采用模型验证
-                if ($this->modelValidate) {
-                    $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
-                    $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
-                    $this->model->validateFailException(true)->validate($validate);
-                }
-                if (empty($params['avatar'])) {
-                    $params['avatar'] = '/assets/img/default_avatar.png';
-                }
-                $ids = $this->model->column("u_id");
-                $invite_no = $this->model->column("invite_no");
-                $params['u_id'] = $this->model->getUinqueId(8, [$ids]);
-                $params['invite_no'] = $this->model->getUinqueNo(8, $invite_no);
-                if (empty($params['nickname'])) {
-                    $params['nickname'] = 'gg_'.$params['u_id'];
-                }
-                $params['image'] = '/assets/img/default_avatar.png';
-                $params['username'] = $params['mobile'];
-                $params['status'] = 'normal';
-                $params['salt'] = Random::alnum();
-                $params['has_info'] = 1;
-                $result = $this->model->allowField(true)->save($params);
-                $userId = $this->model->id;
-                //权限
-                $userPower = new UserPower();
-                $userPowerData['user_id'] = $userId;
-                $userPowerRes = $userPower->insertGetId($userPowerData);
-                if (!$userPowerRes) {
-                    throw new Exception('创建用户权限失败');
-                }
-                //钱包
-                $userwallet = [
-                    'user_id' => $userId,
-                ];
-                $userWalletRes = Db::name('user_wallet')->insertGetId($userwallet);
-                if(!$userWalletRes){
-                    throw new Exception('创建用户钱包失败');
-                }
-                //创建IM用户
-                $tenimService = new TenimService();
-                $imParams['user_id'] = $userPowerRes;
-                $imParams['nickname'] = $params['nickname'];
-                $imParams['avatar'] = cdnurl($params['avatar']);
-                $tenimRes = $tenimService->accountImport($imParams);
-                if (!$tenimRes['status']) {
-                    throw new Exception($tenimRes['msg']);
-                }
-            } catch (ValidateException|PDOException|Exception $e) {
-                Db::rollback();
-                $this->error($e->getMessage());
-            }
-            if ($result == false) {
-               $this->error(__('No rows were inserted'));
-            }
-            Db::commit();
-            $this->success();
-        }
-        return $this->view->fetch();
-    }
-
-    /**
-     * 编辑
-     */
-    public function edit($ids = null)
-    {
-        $row = $this->model->get($ids);
-        if (!$row) {
-            $this->error(__('No Results were found'));
-        }
-        $adminIds = $this->getDataLimitAdminIds();
-        if (is_array($adminIds)) {
-            if (!in_array($row[$this->dataLimitField], $adminIds)) {
-                $this->error(__('You have no permission'));
-            }
-        }
-        if ($this->request->isPost()) {
-            $params = $this->request->post("row/a");
-            if (!$params) {
-                $this->error(__('Parameter %s can not be empty', ''));
-            }
-            $params = $this->preExcludeFields($params);
-            $result = false;
-            try {
-                //是否采用模型验证
-                if ($this->modelValidate) {
-                    $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
-                    $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
-                    $row->validateFailException(true)->validate($validate);
-                }
-                if (!empty($params['u_id'])) {
-                    $userWhere['u_id'] = $params['u_id'];
-                    $userWhere['id'] = ['neq',$ids];
-                    $user = $this->model->where($userWhere)->find();
-                    if (!empty($user)) {
-                        throw new Exception('前端用户ID已存在');
-                    }
-                }
-                if (!empty($params['mobile'])) {
-                    $userWhere['mobile'] = $params['mobile'];
-                    $user = $this->model->where($userWhere)->find();
-                    if (!empty($user)) {
-                        throw new Exception('手机号已存在');
-                    }
-                }
-                $result = $row->allowField(true)->save($params);
-            } catch (ValidateException|PDOException|Exception $e) {
-                $this->error($e->getMessage());
-            }
-            if ($result == false) {
-                $this->error(__('No rows were updated'));
-            }
-            $this->success();
-        }
-        $this->view->assign("row", $row);
-        return $this->view->fetch();
+        $this->model = new \app\admin\model\User;
+        $this->view->assign("isLiveList", $this->model->getIsLiveList());
+        $this->view->assign("isOnlineList", $this->model->getIsOnlineList());
+        $this->view->assign("hasInfoList", $this->model->getHasInfoList());
+        $this->view->assign("isAuthList", $this->model->getIsAuthList());
+        $this->view->assign("isGuildList", $this->model->getIsGuildList());
+        $this->view->assign("statusList", $this->model->getStatusList());
+        $this->view->assign("isCoolList", $this->model->getIsCoolList());
     }
 
-    /**
-     * 删除
-     */
-    public function del($ids = "")
-    {
-        if (!$this->request->isPost()) {
-            $this->error(__("Invalid parameters"));
-        }
-        $ids = $ids ? $ids : $this->request->post("ids");
-        $row = $this->model->get($ids);
-        $this->modelValidate = true;
-        if (!$row) {
-            $this->error(__('No Results were found'));
-        }
-        Auth::instance()->delete($row['id']);
-        $this->success();
-    }
-
-    /**
-     * 详情
-     * @param null $ids
-     * @return string
-     * @throws \think\Exception
-     * @throws \think\exception\DbException
-     */
-    public function detail($ids = null)
+    public function import()
     {
-        /* 判断数据是否存在*/
-        $row = $this->model->get($ids);
-        if (!$row) {
-            $this->error(__('No Results were found'));
-        }
-        /* 判断是否有权限访问*/
-        $adminIds = $this->getDataLimitAdminIds();
-        if (is_array($adminIds)) {
-            if (!in_array($row[$this->dataLimitField], $adminIds)) {
-                $this->error(__('You have no permission'));
-            }
-        }
-
-        $this->view->assign("row", $row);
-        return $this->view->fetch();
+        parent::import();
     }
 
     /**
-     * 编辑
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
-    public function infocheck($ids = null)
-    {
-        $row = $this->model->get($ids);
-        if (!$row) {
-            $this->error(__('No Results were found'));
-        }
-        $adminIds = $this->getDataLimitAdminIds();
-        if (is_array($adminIds)) {
-            if (!in_array($row[$this->dataLimitField], $adminIds)) {
-                $this->error(__('You have no permission'));
-            }
-        }
-        if ($this->request->isPost()) {
-            $params = $this->request->post("row/a");
-            if (!$params) {
-                $this->error(__('Parameter %s can not be empty', ''));
-            }
-            $params = $this->preExcludeFields($params);
-            $result = false;
-            try {
-                //是否采用模型验证
-                if ($this->modelValidate) {
-                    $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
-                    $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
-                    $row->validateFailException(true)->validate($validate);
-                }
-                $nickStatusStr = $statusStr = '';
-                if (isset($params['check_nick_status'])) {
-                    if ($params['check_nick_status'] == 1) {//审核通过 更新昵称
-                        !empty($params['pre_nickname']) && $params['nickname'] = $params['pre_nickname'];
-                        $params['pre_nickname'] = '';
-                        $nickStatusStr = '昵称通过';
-                    } else {//审核拒绝 清空新昵称
-                        $params['pre_nickname'] = '';
-                        $nickStatusStr = '昵称拒绝';
-                    }
-                }
-                if (isset($params['check_status'])) {
-                    if ($params['check_status'] == 1) {//审核通过 更新头像
-                        !empty($params['pre_avatar']) && $params['avatar'] = $params['pre_avatar'];
-                        $params['pre_avatar'] = '';
-                        $statusStr = '头像通过';
-                    } else {//审核拒绝 清空新头像
-                        $params['pre_avatar'] = '';
-                        $statusStr = '头像拒绝';
-                    }
-                }
-                $params['need_check'] = 0;
-
-                $result = $row->allowField(true)->save($params);
-            } catch (ValidateException|PDOException|Exception $e) {
-                $this->error($e->getMessage());
-            }
-            if ($result == false) {
-                $this->error(__('No rows were updated'));
-            }
-            if (!empty($nickStatusStr) || !empty($statusStr)) {
-                //通过发消息
-                $title = '用户信息变更审核通知';
-                $content = '您申请的'.$nickStatusStr.$statusStr;
-                Message::addMessage($row['id'],$title,$content);
-            }
-
-            $this->success();
-        }
-        $checkStatusList = [1=>'通过', 0=>'拒绝'];
-        $showNickname = $showAvatar = 0;
-        if (!empty($row['pre_nickname']) && $row['pre_nickname'] != $row['nickname']) {
-            $showNickname = 1;
-        }
-        if (!empty($row['pre_avatar']) && $row['pre_avatar'] != $row['avatar']) {
-            $showAvatar = 1;
-        }
-        $this->view->assign([
-            'row' => $row,
-            'checkStatusList' => $checkStatusList,
-            'showNickname' => $showNickname,
-            'showAvatar' => $showAvatar,
-        ]);
-        return $this->view->fetch();
-    }
+    
 
-    /**
-     * 钻石充值
-     * @param null $ids
-     * @return string
-     */
-    public function addJewel($ids=null)
-    {
-        /* 判断数据是否存在*/
-        $row = $this->model->get($ids);
-        if (!$row) {
-            $this->error(__('No Results were found'));
-        }
-        /* 判断是否有权限访问*/
-        $adminIds = $this->getDataLimitAdminIds();
-        if (is_array($adminIds)) {
-            if (!in_array($row[$this->dataLimitField], $adminIds)) {
-                $this->error(__('You have no permission'));
-            }
-        }
-        if ($this->request->isPost()) {
-            $params = $this->request->post("row/a");
-            if (!$params) {
-                $this->error(__('Parameter %s can not be empty', ''));
-            }
-            $params = $this->preExcludeFields($params);
-            Db::startTrans();
-            try {
-                //是否采用模型验证
-                if ($this->modelValidate) {
-                    $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
-                    $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
-                    $row->validateFailException(true)->validate($validate);
-                }
-                if (!empty($params['jewel_add'])) {//钻石充值
-                    $userWhere['id'] = $row['id'];
-                    $user = Db::name('user')->where($userWhere)->find();
-                    $userwallet = Db::name('user_wallet')->where('user_id',$row['id'])->find();
-                    $jewelRes = model('Wallet')->lockChangeAccountRemain($row['id'],$params['jewel_add'],'+',0,'钻石充值',17,'jewel');
-                    if ($jewelRes['status'] == false) {
-                        Db::rollback();
-                        $this->error($jewelRes['msg']);
-                    }
-                    $params['jewel'] = bcadd($userwallet['jewel'],$params['jewel_add']);
-                    //充值日志记录
-                    //判断是否首充
-                    $jewellogWhere['user_id'] = $row['id'];
-                    $jewellogWhere['type'] = 1;
-                    $userJewelLog = model('UserJewelLog')->where($jewellogWhere)->find();
-                    $isFirst = 1;
-                    if (!empty($userJewelLog)) {
-                        $isFirst = 0;
-                    }
-                    $preUserId = $user['pre_userid'];
-                    $userRechargeLogRes = model('UserRechargeLog')->addRecord($row['id'], $params['jewel_add'], $userwallet['money'], $params['jewel'], $userwallet['money'], 4, 4,$isFirst,$preUserId);
-                    if (!$userRechargeLogRes) {
-                        throw new Exception('充值记录生成失败');
-                    }
-                }
-                $result = $row->allowField(true)->save($params);
-                if ($result == false) {
-                    throw new Exception(__('No rows were updated'));
-                }
-                Db::commit();
-                $this->success();
-            } catch (ValidateException|PDOException|Exception $e) {
-                Db::rollback();
-                $this->error($e->getMessage());
-            }
-        }
-        $this->view->assign("row", $row);
-        return $this->view->fetch();
-    }
 }

+ 61 - 59
application/admin/lang/zh-cn/user/user.php

@@ -1,63 +1,65 @@
 <?php
 
 return [
-    'Id'                                          => 'ID',
-    'Uid'                                         => '前端用户ID',
-    'Group_id'                                    => '组别ID',
-    'Username'                                    => '用户名',
-    'Nickname'                                    => '昵称',
-    'Pre_nickname'                                => '新昵称',
-    'Password'                                    => '密码',
-    'Salt'                                        => '密码盐',
-    'Email'                                       => '电子邮箱',
-    'Mobile'                                      => '手机号',
-    'Avatar'                                      => '头像',
-    'pre_avatar'                                  => '新头像',
-    'Level'                                       => '等级',
-    'Gender'                                      => '性别',
-    'Age'                                         => '年龄',
-    'Age_id'                                      => '年龄段',
-    'Constellation_id'                            => '星座',
-    'Male'                                        => '男',
-    'FeMale'                                      => '女',
-    'Birthday'                                    => '生日',
-    'Bio'                                         => '格言',
-    'Score'                                       => '积分',
-    'Empirical'                                   => '经验值',
-    'userwallet.Money'                            => '账户余额',
-    'userwallet.Jewel'                            => '钻石余额',
-    'Money_add'                                   => '余额充值',
-    'Jewel_add'                                   => '钻石充值',
-    'Sound_coin'                                  => '声币余额',
-    'Noble'                                       => '贵族',
-    'NobleDuetime'                                => '贵族到期时间',
-    'Successions'                                 => '连续登录天数',
-    'Maxsuccessions'                              => '最大连续登录天数',
-    'Prevtime'                                    => '上次登录时间',
-    'Logintime'                                   => '登录时间',
-    'Loginip'                                     => '最近登录IP',
-    'Loginfailure'                                => '失败次数',
-    'Joinip'                                      => '加入IP',
-    'Jointime'                                    => '加入时间',
-    'Createtime'                                  => '创建时间',
-    'Updatetime'                                  => '更新时间',
-    'Token'                                       => 'Token',
-    'Status'                                      => '状态',
-    'Normal'                                      => '正常',
-    'Hidden'                                      => '封禁',
-    'Cancel'                                      => '取消',
-    'Is_cool'                                     => '靓号',
-    'Is_cool 0'                                   => '否',
-    'Is_cool 1'                                   => '是',
-    'Is_manager'                                  => '管理员',
-    'Is_manager 0'                                => '否',
-    'Is_manager 1'                                => '是',
-    'Is_stealth'                                  => '隐身',
-    'Is_stealth 0'                                => '否',
-    'Is_stealth 1'                                => '是',
-    'Status'                                      => '状态',
-    'Need_check'                                  => '审核状态',
-    'Need_check 0'                                => '正常',
-    'Need_check 1'                                => '待审核',
-    'Leave password blank if dont want to change' => '不修改密码请留空',
+    'Id'               => 'ID',
+    'U_id'             => '前端用户ID',
+    'Username'         => '用户名',
+    'Nickname'         => '昵称',
+    'Password'         => '密码',
+    'Salt'             => '密码盐',
+    'Mobile'           => '手机号',
+    'Avatar'           => '头像',
+    'Image'            => '个人形象照',
+    'Gender'           => '性别',
+    'Age_id'           => '年龄段',
+    'Logintime'        => '登陆时间',
+    'Onlinetime'       => '最近一次上线时间',
+    'Loginip'          => '登录IP',
+    'Joinip'           => '加入IP',
+    'Token'            => 'Token',
+    'Verification'     => '验证',
+    'Is_live'          => '是否在直播',
+    'Is_live 1'        => '是',
+    'Is_live 0'        => '否',
+    'Is_online'        => '是否在线',
+    'Is_online 1'      => '在线',
+    'Is_online 0'      => '离线',
+    'Has_info'         => '是否完善资料',
+    'Has_info 1'       => '是',
+    'Has_info 0'       => '否',
+    'Is_auth'          => '实名认证是否通过',
+    'Is_auth 1'        => '待审核',
+    'Is_auth 0'        => '未申请',
+    'Is_auth -1'       => '未通过',
+    'Is_auth 2'        => '已通过',
+    'Is_guild'         => '公会认证是否通过',
+    'Is_guild 1'       => '待审核',
+    'Is_guild 0'       => '未申请',
+    'Is_guild -1'      => '未通过',
+    'Is_guild 2'       => '已通过',
+    'Is_guild 3'       => '已开通',
+    'Guild_id'         => '公会id',
+    'Status'           => '状态',
+    'Status 1'         => '正常',
+    'Status 0'         => '禁用',
+    'Status -1'        => '注销',
+    'Updatetime'       => '更新时间',
+    'Createtime'       => '创建时间',
+    'Openid'           => '微信openid',
+    'Invite_no'        => '用户邀请码',
+    'Pre_userid'       => '上一级用户ID',
+    'Loginfailure'     => '失败次数',
+    'Province_id'      => '省ID',
+    'City_id'          => '城市ID',
+    'Desc'             => '个性签名',
+    'Is_cool'          => '是否靓号',
+    'Is_cool 0'        => '否',
+    'Is_cool 1'        => '是',
+    'Wealth_level'     => '财富等级',
+    'Wealth_empirical' => '财富值',
+    'Charm_level'      => '魅力等级',
+    'Charm_empirical'  => '魅力值',
+    'Job_id'           => '职业',
+    'Longitude'        => '经度',
+    'Latitude'         => '纬度'
 ];

+ 68 - 116
application/admin/model/User.php

@@ -2,204 +2,156 @@
 
 namespace app\admin\model;
 
-use app\common\model\ScoreLog;
-use fast\Random;
 use think\Model;
 
+
 class User extends Model
 {
 
+    
+
+    
+
     // 表名
     protected $name = 'user';
+    
     // 自动写入时间戳字段
     protected $autoWriteTimestamp = 'int';
+
     // 定义时间戳字段名
     protected $createTime = 'createtime';
     protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
     // 追加属性
     protected $append = [
         'logintime_text',
-        'is_cool_text',
-        'is_manager_text',
-        'is_stealth_text',
-        'need_check_text',
+        'onlinetime_text',
+        'is_live_text',
+        'is_online_text',
+        'has_info_text',
+        'is_auth_text',
+        'is_guild_text',
+        'status_text',
+        'is_cool_text'
     ];
+    
 
-    public function getOriginData()
+    
+    public function getIsLiveList()
     {
-        return $this->origin;
+        return ['1' => __('Is_live 1'), '0' => __('Is_live 0')];
     }
 
-    protected static function init()
+    public function getIsOnlineList()
     {
-        /*self::beforeUpdate(function ($row) {
-            $changed = $row->getChangedData();
-            //如果有修改密码
-            if (isset($changed['password'])) {
-                if ($changed['password']) {
-                    $salt = \fast\Random::alnum();
-                    $row->password = \app\common\library\Auth::instance()->getEncryptPassword($changed['password'], $salt);
-                    $row->salt = $salt;
-                } else {
-                    unset($row->password);
-                }
-            }
-        });*/
-
-
-        /*self::beforeUpdate(function ($row) {
-            $changedata = $row->getChangedData();
-
-            if (isset($changedata['score'])) {
-                $origin = $row->getOriginData();
-                ScoreLog::create(['user_id' => $row['id'], 'score' => $changedata['score'] - $origin['score'], 'before' => $origin['score'], 'after' => $changedata['score'], 'memo' => '管理员变更积分']);
-            }
-        });*/
+        return ['1' => __('Is_online 1'), '0' => __('Is_online 0')];
     }
 
-    public function getGenderList()
+    public function getHasInfoList()
     {
-        return ['1' => __('Male'), '0' => __('Female')];
+        return ['1' => __('Has_info 1'), '0' => __('Has_info 0')];
     }
 
-    public function getStatusList()
+    public function getIsAuthList()
     {
-        return ['normal' => __('Normal'), 'hidden' => __('Hidden'), 'cancel' => __('Cancel')];
+        return ['1' => __('Is_auth 1'), '0' => __('Is_auth 0'), '-1' => __('Is_auth -1'), '2' => __('Is_auth 2')];
     }
 
-    public function getNeedCheckList()
+    public function getIsGuildList()
     {
-        return [0 => __('Need_check 0'), 1 => __('Need_check 1')];
+        return ['1' => __('Is_guild 1'), '0' => __('Is_guild 0'), '-1' => __('Is_guild -1'), '2' => __('Is_guild 2'), '3' => __('Is_guild 3')];
     }
 
-    public function getNeedCheckTextAttr($value, $data)
+    public function getStatusList()
     {
-        $value = $value ? $value : (isset($data['need_check']) ? $data['need_check'] : '');
-        $list = $this->getNeedCheckList();
-        return isset($list[$value]) ? $list[$value] : '';
+        return ['1' => __('Status 1'), '0' => __('Status 0'), '-1' => __('Status -1')];
     }
 
-    public function getPrevtimeTextAttr($value, $data)
+    public function getIsCoolList()
     {
-        $value = $value ? $value : $data['prevtime'];
-        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+        return ['0' => __('Is_cool 0'), '1' => __('Is_cool 1')];
     }
 
+
     public function getLogintimeTextAttr($value, $data)
     {
-        $value = $value ? $value : $data['logintime'];
+        $value = $value ? $value : (isset($data['logintime']) ? $data['logintime'] : '');
         return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
     }
 
-    public function getJointimeTextAttr($value, $data)
+
+    public function getOnlinetimeTextAttr($value, $data)
     {
-        $value = $value ? $value : $data['jointime'];
+        $value = $value ? $value : (isset($data['onlinetime']) ? $data['onlinetime'] : '');
         return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
     }
 
-    protected function setPrevtimeAttr($value)
-    {
-        return $value && !is_numeric($value) ? strtotime($value) : $value;
-    }
 
-    protected function setLogintimeAttr($value)
+    public function getIsLiveTextAttr($value, $data)
     {
-        return $value && !is_numeric($value) ? strtotime($value) : $value;
+        $value = $value ? $value : (isset($data['is_live']) ? $data['is_live'] : '');
+        $list = $this->getIsLiveList();
+        return isset($list[$value]) ? $list[$value] : '';
     }
 
-    protected function setJointimeAttr($value)
-    {
-        return $value && !is_numeric($value) ? strtotime($value) : $value;
-    }
 
-    protected function setBirthdayAttr($value)
+    public function getIsOnlineTextAttr($value, $data)
     {
-        return $value ? $value : null;
+        $value = $value ? $value : (isset($data['is_online']) ? $data['is_online'] : '');
+        $list = $this->getIsOnlineList();
+        return isset($list[$value]) ? $list[$value] : '';
     }
 
-    public function getIsCoolList()
-    {
-        return ['0' =>__('Is_cool 0'), '1' =>__('Is_cool 1')];
-    }
 
-    public function getIsCoolTextAttr($value, $data)
+    public function getHasInfoTextAttr($value, $data)
     {
-        $value = $value ? $value : (isset($data['is_cool']) ? $data['is_cool'] : '');
-        $list = $this->getIsCoolList();
+        $value = $value ? $value : (isset($data['has_info']) ? $data['has_info'] : '');
+        $list = $this->getHasInfoList();
         return isset($list[$value]) ? $list[$value] : '';
     }
 
-    public function getIsManagerList()
-    {
-        return ['0' =>__('Is_manager 0'), '1' =>__('Is_manager 1')];
-    }
 
-    public function getIsManagerTextAttr($value, $data)
+    public function getIsAuthTextAttr($value, $data)
     {
-        $value = $value ? $value : (isset($data['is_manager']) ? $data['is_manager'] : '');
-        $list = $this->getIsManagerList();
+        $value = $value ? $value : (isset($data['is_auth']) ? $data['is_auth'] : '');
+        $list = $this->getIsAuthList();
         return isset($list[$value]) ? $list[$value] : '';
     }
 
-    public function getIsStealthList()
-    {
-        return ['0' =>__('Is_stealth 0'), '1' =>__('Is_stealth 1')];
-    }
 
-    public function getIsStealthTextAttr($value, $data)
+    public function getIsGuildTextAttr($value, $data)
     {
-        $value = $value ? $value : (isset($data['is_stealth']) ? $data['is_stealth'] : '');
-        $list = $this->getIsStealthList();
+        $value = $value ? $value : (isset($data['is_guild']) ? $data['is_guild'] : '');
+        $list = $this->getIsGuildList();
         return isset($list[$value]) ? $list[$value] : '';
     }
 
-    public function userwallet()
-    {
-        return $this->belongsTo('app\admin\model\Userwallet', 'id', 'user_id', [], 'LEFT')->setEagerlyType(0);
-    }
 
-    public function noble()
+    public function getStatusTextAttr($value, $data)
     {
-        return $this->belongsTo('app\admin\model\noble\Level', 'noble', 'id', [], 'LEFT')->setEagerlyType(0);
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
     }
 
-    public function preuser()
-    {
-        return $this->belongsTo('app\admin\model\User', 'pre_userid', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 
-    public function auth()
+    public function getIsCoolTextAttr($value, $data)
     {
-        return $this->belongsTo('app\admin\model\user\Auth', 'id', 'user_id', [], 'LEFT')->setEagerlyType(0);
+        $value = $value ? $value : (isset($data['is_cool']) ? $data['is_cool'] : '');
+        $list = $this->getIsCoolList();
+        return isset($list[$value]) ? $list[$value] : '';
     }
 
-    public function age()
-    {
-        return $this->belongsTo('app\admin\model\Age', 'age_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
-    public function constellation()
+    protected function setLogintimeAttr($value)
     {
-        return $this->belongsTo('app\admin\model\Constellation', 'constellation_id', 'id', [], 'LEFT')->setEagerlyType(0);
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
     }
 
-    public function getUinqueId($length = 8, $ids = [])
+    protected function setOnlinetimeAttr($value)
     {
-        $newid = Random::build("nozero", $length);
-        if (in_array($newid, $ids)) {
-            $newid = $this->getUinqueId($length, $ids);
-        }
-        return $newid;
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
     }
 
-    /**
-     * 生成不重复的随机数字字母组合
-     */
-    function getUinqueNo($length = 8, $nos = [])
-    {
-        $newid = Random::build("alnum", $length);
-        if (in_array($newid, $nos)) {
-            $newid = $this->getUinqueNo($length, $nos);
-        }
-        return $newid;
-    }
+
 }

+ 2 - 19
application/admin/validate/User.php

@@ -10,14 +10,6 @@ class User extends Validate
      * 验证规则
      */
     protected $rule = [
-        'nickname' => 'require|unique:user',
-        'mobile'   => 'unique:user'
-    ];
-
-    /**
-     * 字段描述
-     */
-    protected $field = [
     ];
     /**
      * 提示消息
@@ -29,16 +21,7 @@ class User extends Validate
      */
     protected $scene = [
         'add'  => [],
-        'edit' => ['nickname', 'mobile'],
+        'edit' => [],
     ];
-
-    public function __construct(array $rules = [], $message = [], $field = [])
-    {
-        $this->field = [
-            'nickname' => __('Nickname'),
-            'mobile'   => __('Mobile')
-        ];
-        parent::__construct($rules, $message, $field);
-    }
-
+    
 }

+ 248 - 25
application/admin/view/user/user/add.html

@@ -1,22 +1,46 @@
-<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-    {:token()}
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('U_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-u_id" data-rule="required" data-source="u/index" class="form-control selectpage" name="row[u_id]" type="text" value="">
+        </div>
+    </div>
     <div class="form-group">
-        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-username" class="form-control" name="row[username]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-nickname" class="form-control" name="row[nickname]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
-        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-nickname" data-rule="" class="form-control" name="row[nickname]" type="text" value="">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-password" class="form-control" name="row[password]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Salt')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-salt" class="form-control" name="row[salt]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
-        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
-                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[avatar]" type="text" value="">
+                <input id="c-avatar" class="form-control" size="50" name="row[avatar]" type="text" value="">
                 <div class="input-group-addon no-border no-padding">
                     <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                     <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
@@ -27,40 +51,239 @@
         </div>
     </div>
     <div class="form-group">
-        <label for="c-gender" class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <div class="radio">
-                {foreach name="genderList" item="vo"}
-                <label for="row[gender]-{$key}"><input id="row[gender]-{$key}" name="row[gender]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
-                {/foreach}
+            <div class="input-group">
+                <input id="c-image" class="form-control" size="50" name="row[image]" type="text">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
             </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-gender" data-rule="required" class="form-control" name="row[gender]" type="number" value="0">
         </div>
     </div>
-
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Age_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-age_id" data-rule="required" data-source="age/index" class="form-control selectpage" name="row[age_id]" type="text" value="0">
+            <input id="c-age_id" data-rule="required" data-source="age/index" class="form-control selectpage" name="row[age_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Logintime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-logintime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[logintime]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Onlinetime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-onlinetime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[onlinetime]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Loginip')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-loginip" class="form-control" name="row[loginip]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Joinip')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-joinip" class="form-control" name="row[joinip]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Token')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-token" class="form-control" name="row[token]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Verification')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-verification" class="form-control" name="row[verification]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_live')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_live" class="form-control selectpicker" name="row[is_live]">
+                {foreach name="isLiveList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_online')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_online" class="form-control selectpicker" name="row[is_online]">
+                {foreach name="isOnlineList" item="vo"}
+                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Has_info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-has_info" class="form-control selectpicker" name="row[has_info]">
+                {foreach name="hasInfoList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_auth')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_auth" class="form-control selectpicker" name="row[is_auth]">
+                {foreach name="isAuthList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_manager')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_guild')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <select id="c-is_manager" data-rule="required" class="form-control selectpicker" name="row[is_manager]">
-                {foreach name="isManagerList" item="vo"}
-                <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                        
+            <select  id="c-is_guild" class="form-control selectpicker" name="row[is_guild]">
+                {foreach name="isGuildList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Guild_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-guild_id" data-rule="required" data-source="guild/index" class="form-control selectpage" name="row[guild_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Openid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-openid" class="form-control" name="row[openid]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Invite_no')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-invite_no" class="form-control" name="row[invite_no]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_userid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pre_userid" class="form-control" name="row[pre_userid]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-loginfailure" class="form-control" name="row[loginfailure]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Province_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-province_id" data-rule="required" data-source="province/index" class="form-control selectpage" name="row[province_id]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_stealth')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('City_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <select id="c-is_stealth" data-rule="required" class="form-control selectpicker" name="row[is_stealth]">
-                {foreach name="isStealthList" item="vo"}
-                <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+            <input id="c-city_id" data-rule="required" data-source="city/index" class="form-control selectpage" name="row[city_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-desc" class="form-control" name="row[desc]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_cool')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_cool" data-rule="required" class="form-control selectpicker" name="row[is_cool]">
+                {foreach name="isCoolList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Wealth_level')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-wealth_level" class="form-control" name="row[wealth_level]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Wealth_empirical')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-wealth_empirical" class="form-control" name="row[wealth_empirical]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Charm_level')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-charm_level" class="form-control" name="row[charm_level]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Charm_empirical')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-charm_empirical" class="form-control" name="row[charm_empirical]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Job_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-job_id" data-rule="required" data-source="job/index" class="form-control selectpage" name="row[job_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-longitude" class="form-control" name="row[longitude]" type="text" value="116.403909">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-latitude" class="form-control" name="row[latitude]" type="text" value="39.914133">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 238 - 31
application/admin/view/user/user/edit.html

@@ -1,29 +1,46 @@
 <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-    {:token()}
-    <input type="hidden" name="row[id]" value="{$row.id}">
+
     <div class="form-group">
-        <label for="c-u_id" class="control-label col-xs-12 col-sm-2">{:__('Uid')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-u_id" data-rule="required" class="form-control" name="row[u_id]" type="text" value="{$row.u_id|htmlentities}">
+        <label class="control-label col-xs-12 col-sm-2">{:__('U_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-u_id" data-rule="required" data-source="u/index" class="form-control selectpage" name="row[u_id]" type="text" value="{$row.u_id|htmlentities}">
         </div>
     </div>
     <div class="form-group">
-        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="{$row.nickname|htmlentities}">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-username" class="form-control" name="row[username]" type="text" value="{$row.username|htmlentities}">
         </div>
     </div>
     <div class="form-group">
-        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-mobile" data-rule="" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-nickname" class="form-control" name="row[nickname]" type="text" value="{$row.nickname|htmlentities}">
         </div>
     </div>
     <div class="form-group">
-        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-password" class="form-control" name="row[password]" type="text" value="{$row.password|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Salt')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-salt" class="form-control" name="row[salt]" type="text" value="{$row.salt|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
-                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[avatar]" type="text" value="{$row.avatar}">
+                <input id="c-avatar" class="form-control" size="50" name="row[avatar]" type="text" value="{$row.avatar|htmlentities}">
                 <div class="input-group-addon no-border no-padding">
                     <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                     <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
@@ -34,49 +51,239 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_cool')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <select id="c-is_cool" data-rule="required" class="form-control selectpicker" name="row[is_cool]">
-                {foreach name="isCoolList" item="vo"}
-                    <option value="{$key}" {in name="key" value="$row.is_cool"}selected{/in}>{$vo}</option>
+            <div class="input-group">
+                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-gender" data-rule="required" class="form-control" name="row[gender]" type="number" value="{$row.gender|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Age_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-age_id" data-rule="required" data-source="age/index" class="form-control selectpage" name="row[age_id]" type="text" value="{$row.age_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Logintime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-logintime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[logintime]" type="text" value="{:$row.logintime?datetime($row.logintime):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Onlinetime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-onlinetime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[onlinetime]" type="text" value="{:$row.onlinetime?datetime($row.onlinetime):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Loginip')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-loginip" class="form-control" name="row[loginip]" type="text" value="{$row.loginip|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Joinip')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-joinip" class="form-control" name="row[joinip]" type="text" value="{$row.joinip|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Token')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-token" class="form-control" name="row[token]" type="text" value="{$row.token|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Verification')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-verification" class="form-control" name="row[verification]" type="text" value="{$row.verification|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_live')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_live" class="form-control selectpicker" name="row[is_live]">
+                {foreach name="isLiveList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_live"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
+
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_manager')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_online')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <select id="c-is_manager" data-rule="required" class="form-control selectpicker" name="row[is_manager]">
-                {foreach name="isManagerList" item="vo"}
-                <option value="{$key}" {in name="key" value="$row.is_manager"}selected{/in}>{$vo}</option>
+                        
+            <select  id="c-is_online" class="form-control selectpicker" name="row[is_online]">
+                {foreach name="isOnlineList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_online"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
+
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_stealth')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Has_info')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <select id="c-is_stealth" data-rule="required" class="form-control selectpicker" name="row[is_stealth]">
-                {foreach name="isStealthList" item="vo"}
-                <option value="{$key}" {in name="key" value="$row.is_stealth"}selected{/in}>{$vo}</option>
+                        
+            <select  id="c-has_info" class="form-control selectpicker" name="row[has_info]">
+                {foreach name="hasInfoList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.has_info"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
+
         </div>
     </div>
     <div class="form-group">
-        <label for="c-gender" class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_auth')}:</label>
         <div class="col-xs-12 col-sm-8">
-            {:build_radios('row[gender]', ['1'=>__('Male'), '0'=>__('Female')], $row['gender'])}
+                        
+            <select  id="c-is_auth" class="form-control selectpicker" name="row[is_auth]">
+                {foreach name="isAuthList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_auth"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
         </div>
     </div>
     <div class="form-group">
-        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_guild')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <div class="radio">
-                {foreach name="statusList" item="vo"}
-                    <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
+                        
+            <select  id="c-is_guild" class="form-control selectpicker" name="row[is_guild]">
+                {foreach name="isGuildList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_guild"}selected{/in}>{$vo}</option>
                 {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Guild_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-guild_id" data-rule="required" data-source="guild/index" class="form-control selectpage" name="row[guild_id]" type="text" value="{$row.guild_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
             </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Openid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-openid" class="form-control" name="row[openid]" type="text" value="{$row.openid|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Invite_no')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-invite_no" class="form-control" name="row[invite_no]" type="text" value="{$row.invite_no|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_userid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pre_userid" class="form-control" name="row[pre_userid]" type="number" value="{$row.pre_userid|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-loginfailure" class="form-control" name="row[loginfailure]" type="number" value="{$row.loginfailure|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Province_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-province_id" data-rule="required" data-source="province/index" class="form-control selectpage" name="row[province_id]" type="text" value="{$row.province_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-city_id" data-rule="required" data-source="city/index" class="form-control selectpage" name="row[city_id]" type="text" value="{$row.city_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-desc" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_cool')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_cool" data-rule="required" class="form-control selectpicker" name="row[is_cool]">
+                {foreach name="isCoolList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_cool"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Wealth_level')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-wealth_level" class="form-control" name="row[wealth_level]" type="number" value="{$row.wealth_level|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Wealth_empirical')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-wealth_empirical" class="form-control" name="row[wealth_empirical]" type="number" value="{$row.wealth_empirical|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Charm_level')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-charm_level" class="form-control" name="row[charm_level]" type="number" value="{$row.charm_level|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Charm_empirical')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-charm_empirical" class="form-control" name="row[charm_empirical]" type="number" value="{$row.charm_empirical|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Job_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-job_id" data-rule="required" data-source="job/index" class="form-control selectpage" name="row[job_id]" type="text" value="{$row.job_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-longitude" class="form-control" name="row[longitude]" type="text" value="{$row.longitude|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-latitude" class="form-control" name="row[latitude]" type="text" value="{$row.latitude|htmlentities}">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 16 - 7
application/admin/view/user/user/index.html

@@ -1,20 +1,27 @@
 <div class="panel panel-default panel-intro">
+    
     <div class="panel-heading">
         {:build_heading(null,FALSE)}
-        <ul class="nav nav-tabs" data-field="need_check">
-            <li class="{:$Think.get.need_check == null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
-            {foreach name="needCheckList" item="vo"}
-            <li class="{:$Think.get.need_check == (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>
 
+
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
-                        {:build_toolbar('refresh,add,edit')}
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user/user/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user/user/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user/user/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('user/user/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
+
                         <div class="dropdown btn-group {:$auth->check('user/user/multi')?'':'hide'}">
                             <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
                             <ul class="dropdown-menu text-left" role="menu">
@@ -22,10 +29,12 @@
                                 <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
                             </ul>
                         </div>
+
+                        
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('user/user/edit')}"
-                           data-operate-detail="{:$auth->check('user/user/detail')}"
+                           data-operate-edit="{:$auth->check('user/user/edit')}" 
+                           data-operate-del="{:$auth->check('user/user/del')}" 
                            width="100%">
                     </table>
                 </div>

+ 44 - 86
public/assets/js/backend/user/user.js

@@ -5,12 +5,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
-                    index_url: 'user/user/index',
+                    index_url: 'user/user/index' + location.search,
                     add_url: 'user/user/add',
                     edit_url: 'user/user/edit',
+                    del_url: 'user/user/del',
                     multi_url: 'user/user/multi',
-                    infocheck_url: 'user/user/infocheck',
-                    addjewel_url: 'user/user/add_jewel',
+                    import_url: 'user/user/import',
                     table: 'user',
                 }
             });
@@ -21,91 +21,58 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
-                sortName: 'user.id',
+                sortName: 'id',
                 columns: [
                     [
                         {checkbox: true},
-                        {field: 'id', title: __('Id'), sortable: true},
-                        {field: 'u_id', title: __('Uid'), sortable: true},
-                        {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
+                        {field: 'id', title: __('Id')},
+                        {field: 'u_id', title: __('U_id')},
+                        {field: 'username', title: __('Username'), operate: 'LIKE'},
                         {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
+                        {field: 'password', title: __('Password'), operate: 'LIKE'},
+                        {field: 'salt', title: __('Salt'), operate: 'LIKE'},
                         {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
-                        // {field: '查看', title: __('下级用户'), formatter: function(value, row, index){
-                        //         return '<a href="usererji/index?parent_id='+row.id+'" ' +
-                        //             'class="label label-info jump" style="cursor: pointer" ' +
-                        //             'data-toggle="tooltip" title="查看下级用户">查看</a>';
-                        // }},
-                        // {field: 'preuser.u_id', title: __('上级代理ID')},
-                        // {field: 'preuser.nickname', title: __('上级代理昵称'), formatter: function(value, row, index){
-                        //         if(!value) {
-                        //             return "平台";
-                        //         } else {
-                        //             return value;
-                        //         }
-                        //     }},
-                        // {field: 'auth.realname', title: __('真实姓名')},
-                        // {field: 'auth.idcard', title: __('身份证号')},
-                        // {field: 'chargetime', title: __('最近一次充值时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        // {field: 'onlinetime', title: __('最近一次上线时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        // {field: 'chargecount', title: __('总充值金额')},
-                        // {field: 'rebatecount', title: __('总获得返利金额')},
-                        {field: 'gender', title: __('Gender'), searchList: {1: __('Male'), 0: __('Female')}, formatter: Table.api.formatter.normal},
-                        // {field: 'age', title: __('Age'), operate: 'LIKE'},
-                        // {field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
-                        // {field: 'empirical', title: __('Empirical'), operate: 'LIKE'},
-                        {field: 'userwallet.money', title: __('userwallet.money'), operate: false, sortable: true, width:100},
-                        {field: 'userwallet.jewel', title: __('userwallet.jewel'), operate: false, sortable: true, width:100},
-                        // {field: 'sound_coin', title: __('Sound_coin'), operate: 'LIKE'},
-                        // {field: 'noble.name', title: __('Noble'), operate: 'LIKE'},
-                        // {field: 'noble_duetime', title: __('NobleDuetime'), formatter: Table.api.formatter.datetime, operate: 'RANGE'},
-                        {field: 'age.name', title: __('Age_id'), operate: false},
-                        {field: 'constellation.name', title: __('Constellation_id'), operate: false},
-                        {field: 'is_cool', title: __('Is_cool'), searchList:{'0': __('Is_cool 0'), '1':__('Is_cool 1')}, formatter: Table.api.formatter.status},
-                        {field: 'is_manager', title: __('Is_manager'), searchList:{'0' : __('Is_manager 0'), '1':__('Is_manager 1')}, formatter: Table.api.formatter.status},
-                        {field: 'is_stealth', title: __('Is_stealth'), searchList:{'0' :__('Is_stealth 0'), '1' :__('Is_stealth 1')}, formatter: Table.api.formatter.status},
-                        {field: 'logintime', title: __('Logintime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        {field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search},
-                        {field: 'createtime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        {field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search},
-                        {field: 'need_check', title: __('Need_check'), searchList:{'0':__('Need_check 0'), '1' :__('Need_check 1')}, formatter: Table.api.formatter.status},
-                        {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
-                        {
-                            field: 'operate', title: __('Operate'), buttons: [
-                                {
-                                    name: 'infocheck',
-                                    title: __('信息审核'),
-                                    classname: 'btn btn-xs btn-warning btn-dialog',
-                                    icon: 'fa fa-leaf',
-                                    url: 'user/user/infoCheck',
-                                    visible: function (row) {
-                                        if ((row.pre_nickname != '' && row.pre_nickname != row.nickname) || (row.pre_avatar != '' && row.pre_avatar != row.avatar)) {
-                                            return true;
-                                        } else  {
-                                            return false;
-                                        }
-                                    }
-                                },{
-                                    name: 'detail',
-                                    title: __('查看详情'),
-                                    classname: 'btn btn-xs btn-primary btn-dialog',
-                                    icon: 'fa fa-list',
-                                    url: 'user/user/detail',
-                                }, {
-                                    name: 'addjewel',
-                                    title: __('充值'),
-                                    classname: 'btn btn-xs btn-info btn-dialog',
-                                    icon: 'fa fa-diamond',
-                                    url: 'user/user/addJewel',
-                                },
-                            ], table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate
-                        }
+                        {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'gender', title: __('Gender')},
+                        {field: 'age_id', title: __('Age_id')},
+                        {field: 'logintime', title: __('Logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'onlinetime', title: __('Onlinetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'loginip', title: __('Loginip'), operate: 'LIKE'},
+                        {field: 'joinip', title: __('Joinip'), operate: 'LIKE'},
+                        {field: 'token', title: __('Token'), operate: 'LIKE'},
+                        {field: 'verification', title: __('Verification'), operate: 'LIKE'},
+                        {field: 'is_live', title: __('Is_live'), searchList: {"1":__('Is_live 1'),"0":__('Is_live 0')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_online', title: __('Is_online'), searchList: {"1":__('Is_online 1'),"0":__('Is_online 0')}, formatter: Table.api.formatter.normal},
+                        {field: 'has_info', title: __('Has_info'), searchList: {"1":__('Has_info 1'),"0":__('Has_info 0')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_auth', title: __('Is_auth'), searchList: {"1":__('Is_auth 1'),"0":__('Is_auth 0'),"-1":__('Is_auth -1'),"2":__('Is_auth 2')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_guild', title: __('Is_guild'), searchList: {"1":__('Is_guild 1'),"0":__('Is_guild 0'),"-1":__('Is_guild -1'),"2":__('Is_guild 2'),"3":__('Is_guild 3')}, formatter: Table.api.formatter.normal},
+                        {field: 'guild_id', title: __('Guild_id')},
+                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0'),"-1":__('Status -1')}, formatter: Table.api.formatter.status},
+                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'openid', title: __('Openid'), operate: 'LIKE'},
+                        {field: 'invite_no', title: __('Invite_no'), operate: 'LIKE'},
+                        {field: 'pre_userid', title: __('Pre_userid')},
+                        {field: 'loginfailure', title: __('Loginfailure')},
+                        {field: 'province_id', title: __('Province_id')},
+                        {field: 'city_id', title: __('City_id')},
+                        {field: 'desc', title: __('Desc'), operate: 'LIKE'},
+                        {field: 'is_cool', title: __('Is_cool'), searchList: {"0":__('Is_cool 0'),"1":__('Is_cool 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'wealth_level', title: __('Wealth_level')},
+                        {field: 'wealth_empirical', title: __('Wealth_empirical')},
+                        {field: 'charm_level', title: __('Charm_level')},
+                        {field: 'charm_empirical', title: __('Charm_empirical')},
+                        {field: 'job_id', title: __('Job_id')},
+                        {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+                        {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]
             });
 
             // 为表格绑定事件
             Table.api.bindevent(table);
-            table.off('dbl-click-row.bs.table');
         },
         add: function () {
             Controller.api.bindevent();
@@ -113,15 +80,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         edit: function () {
             Controller.api.bindevent();
         },
-        detail: function () {
-            Controller.api.bindevent();
-        },
-        infocheck: function () {
-            Controller.api.bindevent();
-        },
-        addjewel: function () {
-            Controller.api.bindevent();
-        },
         api: {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"));

+ 17 - 1
user字段删除.txt

@@ -32,4 +32,20 @@ is_recharge
 noble
 noble_duetime
 
-////////////////////////////52
+////////////////////////////52个
+
+删除字段
+pay_password
+pay_salt
+constellation_id
+is_anchor
+is_manager
+is_stealth
+age
+level
+empirical
+chargetime
+ipaddress
+
+////////////////////41个
+