正在显示
1 个修改的文件
包含
13 行增加
和
0 行删除
@@ -197,6 +197,18 @@ class User extends Backend | @@ -197,6 +197,18 @@ class User extends Backend | ||
197 | if(!empty($user)){ | 197 | if(!empty($user)){ |
198 | $row['openid'] = $user['openid']; | 198 | $row['openid'] = $user['openid']; |
199 | } | 199 | } |
200 | + | ||
201 | + $row['is_default'] = false; | ||
202 | + $user = new \app\admin\model\User; | ||
203 | + $user = $user->where(['mobile'=>$mobile,'is_default'=>true])->find(); | ||
204 | + if(empty($user)){ | ||
205 | + $row['is_default'] = true; | ||
206 | + }else{ | ||
207 | + if(empty($user['username']) || empty($user['nickname'])){ | ||
208 | + $row['is_default'] = true; | ||
209 | + } | ||
210 | + } | ||
211 | + | ||
200 | } | 212 | } |
201 | 213 | ||
202 | $insert[] = $row; | 214 | $insert[] = $row; |
@@ -235,6 +247,7 @@ class User extends Backend | @@ -235,6 +247,7 @@ class User extends Backend | ||
235 | } | 247 | } |
236 | 248 | ||
237 | foreach ($insert as $k => $v) { | 249 | foreach ($insert as $k => $v) { |
250 | + | ||
238 | $v['status'] = 'normal'; | 251 | $v['status'] = 'normal'; |
239 | $id = $this->model->insertGetId($v); | 252 | $id = $this->model->insertGetId($v); |
240 | if (!empty($col)) { | 253 | if (!empty($col)) { |
-
请 注册 或 登录 后发表评论