'正常', 2 => '冻结', ); $level = array ( 1 => '普通', 2 => '元老', 3 => '小编', 10 => '管理员', ); $weixin = array ( 1 => '已关注', 2 => '未关注', ); $bind = array ( 1 => '已绑定', 2 => '未绑定', ); $email = Dever::rule('email'); $mobile = Dever::rule('mobile'); return array ( 'email' => $email, 'mobile' => $mobile, # 表名 'name' => 'user', # 显示给用户看的名称 'lang' => '用户管理', 'order' => 10, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => '用户ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', 'list' => true, ), 'email' => array ( 'type' => 'varchar-150', 'name' => '邮箱', 'default' => '', 'desc' => '请输入邮箱', 'match' => $email, 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'username' => array ( 'type' => 'varchar-50', 'name' => '用户名', 'default' => '', 'desc' => '请输入用户名', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'mobile' => array ( 'type' => 'varchar-32', 'name' => '手机号', 'default' => '', 'desc' => '请输入用户手机号', 'match' => $mobile, 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'password' => array ( 'type' => 'varchar-50', 'name' => '密码', 'default' => '', 'desc' => '请输入密码', 'match' => 'option', 'update' => 'password', 'callback' => 'md5', ), 'avatar' => array ( 'type' => 'varchar-150', 'name' => '头像', 'default' => '', 'desc' => '请选择头像', 'match' => 'option', 'update' => 'image', 'key' => '1', 'place' => '150', ), 'info' => array ( 'type' => 'varchar-255', 'name' => '介绍-选填,如果想清空该介绍,请输入null。', 'default' => '', 'desc' => '请输入介绍', 'match' => 'option', 'update' => 'editor', ), 'level' => array ( 'type' => 'tinyint-1', 'name' => '用户等级', 'default' => '1', 'desc' => '请选择用户等级', 'match' => 'is_numeric', //'option' => $level, //'update' => 'radio', //'list' => true, ), 'login_date' => array ( 'type' => 'int-11', 'name' => '最近登录', 'match' => array('is_numeric', time()), 'desc' => '', 'default' => '0', //'list' => 'date("Y-m-d H:i:s", {login_date})', ), 'reg_date' => array ( 'type' => 'int-11', 'name' => '注册时间', 'match' => array('is_numeric', time()), 'desc' => '', 'default' => '0', ), 'bind' => array ( 'type' => 'tinyint-1', 'name' => '是否绑定手机', 'default' => '2', 'desc' => '请选择是否绑定手机', 'match' => 'is_numeric', //'option' => $bind, //'update' => 'radio', ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', 'option' => $option, 'update' => 'radio', ), 'cdate' => array ( 'type' => 'int-11', 'name' => '注册时间', 'match' => array('is_numeric', time()), 'desc' => '', # 只有insert时才生效 'insert' => true, //'list' => 'date("Y-m-d H:i:s", {cdate})', ), ), # 更新表结构 /* 'alter' => array ( 1 => array ( array('add', 'bind', 'bind', 'tinyint-1 2 是否绑定手机'), ), 'version' => 1, ), */ # request 请求接口定义 'request' => array ( # 此处定义是为跳出auth 'login' => array ( 'option' => array ( 'username' => 'yes', 'mobile' => 'yes', 'email' => 'yes', 'password' => 'yes', ), 'type' => 'one', ), # 验证手机号是否被使用 'checkMobile' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'mobile' => 'yes', 'id' => array('yes', '!='), ), 'type' => 'one', ), ), );