推广分佣功能开发
This commit is contained in:
@@ -4,6 +4,7 @@ namespace app\api\controller;
|
||||
|
||||
use app\common\controller\Api;
|
||||
use app\common\model\User;
|
||||
use app\common\service\PromotionService;
|
||||
use app\common\service\UserService;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\Validate;
|
||||
@@ -65,6 +66,8 @@ class Auth extends Api
|
||||
$this->error('参数错误');
|
||||
}
|
||||
$user = UserService::wxLogin($code);
|
||||
//通过分享链接/小程序码进入时携带推广人ID,首次进入即绑定
|
||||
PromotionService::bindPromoter(intval($user->id), intval($this->request->post('promoter_id', 0)));
|
||||
$this->auth->direct($user->id);
|
||||
$userInfo = $this->auth->getUserinfo();
|
||||
$this->success('登录成功', ['userinfo' => $this->auth->getUserinfo(), 'token' => $userInfo['token']]);
|
||||
|
||||
Reference in New Issue
Block a user