更新
This commit is contained in:
parent
16d3fd73b3
commit
96fa4ea922
@ -661,14 +661,19 @@ class UserRepository extends BaseRepository
|
|||||||
public function registr(string $phone, ?string $pwd, $user_type = 'h5')
|
public function registr(string $phone, ?string $pwd, $user_type = 'h5')
|
||||||
{
|
{
|
||||||
$pwd = $pwd ? $this->encodePassword($pwd) : $this->encodePassword($this->dao->defaultPwd());
|
$pwd = $pwd ? $this->encodePassword($pwd) : $this->encodePassword($this->dao->defaultPwd());
|
||||||
|
$ip=app('request')->ip();
|
||||||
|
$code=Cache::get('promote_'.$ip);
|
||||||
$data = [
|
$data = [
|
||||||
'account' => $phone,
|
'account' => $phone,
|
||||||
'pwd' => $pwd,
|
'pwd' => $pwd,
|
||||||
'nickname' => substr($phone, 0, 3) . '****' . substr($phone, 7, 4),
|
'nickname' => substr($phone, 0, 3) . '****' . substr($phone, 7, 4),
|
||||||
'avatar' => '',
|
'avatar' => '',
|
||||||
'phone' => $phone,
|
'phone' => $phone,
|
||||||
'last_ip' => app('request')->ip()
|
'last_ip' => $ip
|
||||||
];
|
];
|
||||||
|
if($code){
|
||||||
|
$data['promotion_code']=$code;
|
||||||
|
}
|
||||||
return $this->create($user_type, $data);
|
return $this->create($user_type, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,4 +624,14 @@ class Common extends BaseController
|
|||||||
}
|
}
|
||||||
return app('json')->success($list);
|
return app('json')->success($list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广写入
|
||||||
|
*/
|
||||||
|
public function promote_writing()
|
||||||
|
{
|
||||||
|
$code = $this->request->param('code');
|
||||||
|
Cache::set('promote_' . app('request')->ip(), $code, 86400);
|
||||||
|
return app('json')->success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ use think\facade\Route;
|
|||||||
|
|
||||||
Route::group('api/', function () {
|
Route::group('api/', function () {
|
||||||
Route::any('test', 'api.Auth/test');
|
Route::any('test', 'api.Auth/test');
|
||||||
|
Route::any('promote_writing', 'api.Common/promote_writing');
|
||||||
Route::any('applet', 'api.Common/applet');
|
Route::any('applet', 'api.Common/applet');
|
||||||
Route::get('label_lst', 'api.Common/label_lst');
|
Route::get('label_lst', 'api.Common/label_lst');
|
||||||
Route::any('system_group_value', 'api.Common/system_group_value');
|
Route::any('system_group_value', 'api.Common/system_group_value');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user