作者 xwp
1 个管道 的构建 通过 耗费 1 秒

后台修改

... ... @@ -197,18 +197,6 @@ class User extends Backend
if(!empty($user)){
$row['openid'] = $user['openid'];
}
$row['is_default'] = false;
$user = new \app\admin\model\User;
$user = $user->where(['mobile'=>$mobile,'is_default'=>true])->find();
if(empty($user)){
$row['is_default'] = true;
}else{
if(empty($user['username']) || empty($user['nickname'])){
$row['is_default'] = true;
}
}
}
$insert[] = $row;
... ... @@ -248,6 +236,17 @@ class User extends Backend
foreach ($insert as $k => $v) {
$v['is_default'] = false;
$user = new \app\admin\model\User;
$user = $user->where(['mobile'=>$v['mobile'],'is_default'=>true])->find();
if(empty($user)){
$v['is_default'] = true;
}else{
if(empty($user['username']) || empty($user['nickname'])){
$v['is_default'] = true;
}
}
$v['status'] = 'normal';
$id = $this->model->insertGetId($v);
if (!empty($col)) {
... ...