|
|
@@ -1185,6 +1185,14 @@ class UserRepository extends BaseRepository
|
|
1185
|
1185
|
//$repository->registr($data['phone'], $data['password'],'APP',"","",$data['spread']);
|
|
1186
|
1186
|
public function registr(string $phone, ?string $pwd, $user_type = 'h5',$url="",$nickname="",$external=1,$spread_uid=null)
|
|
1187
|
1187
|
{
|
|
|
1188
|
+ $user_res = Db::name('user')->where('phone', $phone)->find();
|
|
|
1189
|
+ if ($user_res && !$user_res['account']) {
|
|
|
1190
|
+ $data = [
|
|
|
1191
|
+ 'account' => $phone,
|
|
|
1192
|
+ ];
|
|
|
1193
|
+ $this->dao->update($user_res['uid'], $data);
|
|
|
1194
|
+ return $this->dao->get($user_res['uid']);
|
|
|
1195
|
+ }
|
|
1188
|
1196
|
|
|
1189
|
1197
|
$pwd = $pwd ? $this->encodePassword($pwd) : $this->encodePassword($this->dao->defaultPwd());
|
|
1190
|
1198
|
$data = [
|