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

后台修改

@@ -197,18 +197,6 @@ class User extends Backend @@ -197,18 +197,6 @@ 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 -  
212 } 200 }
213 201
214 $insert[] = $row; 202 $insert[] = $row;
@@ -248,6 +236,17 @@ class User extends Backend @@ -248,6 +236,17 @@ class User extends Backend
248 236
249 foreach ($insert as $k => $v) { 237 foreach ($insert as $k => $v) {
250 238
  239 + $v['is_default'] = false;
  240 + $user = new \app\admin\model\User;
  241 + $user = $user->where(['mobile'=>$v['mobile'],'is_default'=>true])->find();
  242 + if(empty($user)){
  243 + $v['is_default'] = true;
  244 + }else{
  245 + if(empty($user['username']) || empty($user['nickname'])){
  246 + $v['is_default'] = true;
  247 + }
  248 + }
  249 +
251 $v['status'] = 'normal'; 250 $v['status'] = 'normal';
252 $id = $this->model->insertGetId($v); 251 $id = $this->model->insertGetId($v);
253 if (!empty($col)) { 252 if (!empty($col)) {