From 4931ba2f5faf53dc7152ea6bd49a611c2ac3ef3c Mon Sep 17 00:00:00 2001 From: limu <610543851@qq.com> Date: Tue, 23 Jan 2024 09:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/user/User.php | 5 +++++ app/common/repositories/user/UserRepository.php | 3 +++ app/controller/api/Auth.php | 2 ++ 3 files changed, 10 insertions(+) diff --git a/app/common/model/user/User.php b/app/common/model/user/User.php index 4d25201..d02805b 100644 --- a/app/common/model/user/User.php +++ b/app/common/model/user/User.php @@ -166,6 +166,11 @@ class User extends BaseModel return $this->hasOne(User::class, 'uid', 'spread_uid'); } + public function spread2() + { + return $this->hasOne(User::class, 'uid', 'spread_uid2'); + } + public function brokerage() { return $this->hasOne(UserBrokerage::class, 'brokerage_level', 'brokerage_level')->where('type',0); diff --git a/app/common/repositories/user/UserRepository.php b/app/common/repositories/user/UserRepository.php index 27dda8a..cd47a2c 100644 --- a/app/common/repositories/user/UserRepository.php +++ b/app/common/repositories/user/UserRepository.php @@ -201,6 +201,9 @@ class UserRepository extends BaseRepository 'spread' => function ($query) { $query->field('uid,nickname,spread_uid'); }, + 'spread2' => function ($query) { + $query->field('uid,nickname,spread_uid2'); + }, 'member' => function ($query) { $query->field('user_brokerage_id,brokerage_level,brokerage_name,brokerage_icon'); }, diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 3a3a357..90ec384 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -447,6 +447,7 @@ class Auth extends BaseController 'types_of' => 1, 'ctime' => date('Y-m-d H:i:s'), 'memo' => '邀请好友获得品宣积分' . env('brand.brand_integral', '100'), + 'user_id' => $data['tid'], ]); } @@ -461,6 +462,7 @@ class Auth extends BaseController 'types_of' => 1, 'ctime' => date('Y-m-d H:i:s'), 'memo' => '注册赠送品宣积分' . env('brand.brand_integral', '100'), + 'user_id' => $user->uid, ]); return app('json')->success($repository->returnToken($user, $tokenInfo)); }