作者 何书鹏
1 个管道 的构建 通过 耗费 2 秒

用户手机号

... ... @@ -107,8 +107,11 @@ class User extends Backend
// if ($result === false) {
// $this->error($this->model->getError());
// }
if ($params['mobile'] && \app\common\model\User::where('mobile', $params['mobile'])->find()) {
$this->error('注册手机号已存在');
if ($params['mobile']) {
if(\app\common\model\User::where('mobile', $params['mobile'])->find()){
$this->error('注册手机号已存在');
}
$params['phone'] = $params['mobile'];
}
$result = false;
Db::startTrans();
... ... @@ -193,8 +196,11 @@ class User extends Backend
// if(strlen($params['username']) < 6 || strlen($params['username']) > 18) {
// $this->error('用户名须为6-18位');
// }
if ($params['mobile'] && \app\common\model\User::where('mobile', $params['mobile'])->where('id', '<>', $row->id)->find()) {
$this->error('注册手机号已存在');
if ($params['mobile']) {
if(\app\common\model\User::where('mobile', $params['mobile'])->where('id', '<>', $row->id)->find()){
$this->error('注册手机号已存在');
}
$params['phone'] = $params['mobile'];
}
$result = false;
Db::startTrans();
... ...
... ... @@ -49,7 +49,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'nickname', title: __('真实姓名'), operate:'LIKE'},
{field: 'password', title: __('密码'), operate:false},
{field: 'card', title: __('身份证'), operate:false},
{field: 'phone', title: __('手机号'), operate:false},
// {field: 'phone', title: __('手机号'), operate:false},
{field: 'sex', title: __('性别'), searchList: {"1":"男","2":'女'},formatter: Table.api.formatter.flag},
{field: 'work_address', title: __('工作地点'),operate:'LIKE'},
{field: 'image', title: __('头像'), operate:false, events: Table.api.events.image, formatter: Table.api.formatter.image},
... ... @@ -79,7 +79,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'expirationtime', title: __('有效期'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
{field: 'mobile', title: __('注册手机号')},
{field: 'mobile', title: __('手机号')},
{field: 'group_id', title: __('角色'), searchList: {"0":"普通用户","1":"企业管理员"},formatter: Table.api.formatter.flag},
{field: 'createtime', title: __('注册时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
{field: 'user.mobile_exam_ids', title: __('参加的考试'), operate: 'FIND_IN_SET', searchList: Config.mobileExamList,formatter: Table.api.formatter.flag},
... ...