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

后台修改

@@ -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)) {