字段调整

main
limu 10 months ago
parent ffcc499cce
commit 4931ba2f5f
  1. 5
      app/common/model/user/User.php
  2. 3
      app/common/repositories/user/UserRepository.php
  3. 2
      app/controller/api/Auth.php

@ -166,6 +166,11 @@ class User extends BaseModel
return $this->hasOne(User::class, 'uid', 'spread_uid'); return $this->hasOne(User::class, 'uid', 'spread_uid');
} }
public function spread2()
{
return $this->hasOne(User::class, 'uid', 'spread_uid2');
}
public function brokerage() public function brokerage()
{ {
return $this->hasOne(UserBrokerage::class, 'brokerage_level', 'brokerage_level')->where('type',0); return $this->hasOne(UserBrokerage::class, 'brokerage_level', 'brokerage_level')->where('type',0);

@ -201,6 +201,9 @@ class UserRepository extends BaseRepository
'spread' => function ($query) { 'spread' => function ($query) {
$query->field('uid,nickname,spread_uid'); $query->field('uid,nickname,spread_uid');
}, },
'spread2' => function ($query) {
$query->field('uid,nickname,spread_uid2');
},
'member' => function ($query) { 'member' => function ($query) {
$query->field('user_brokerage_id,brokerage_level,brokerage_name,brokerage_icon'); $query->field('user_brokerage_id,brokerage_level,brokerage_name,brokerage_icon');
}, },

@ -447,6 +447,7 @@ class Auth extends BaseController
'types_of' => 1, 'types_of' => 1,
'ctime' => date('Y-m-d H:i:s'), 'ctime' => date('Y-m-d H:i:s'),
'memo' => '邀请好友获得品宣积分' . env('brand.brand_integral', '100'), 'memo' => '邀请好友获得品宣积分' . env('brand.brand_integral', '100'),
'user_id' => $data['tid'],
]); ]);
} }
@ -461,6 +462,7 @@ class Auth extends BaseController
'types_of' => 1, 'types_of' => 1,
'ctime' => date('Y-m-d H:i:s'), 'ctime' => date('Y-m-d H:i:s'),
'memo' => '注册赠送品宣积分' . env('brand.brand_integral', '100'), 'memo' => '注册赠送品宣积分' . env('brand.brand_integral', '100'),
'user_id' => $user->uid,
]); ]);
return app('json')->success($repository->returnToken($user, $tokenInfo)); return app('json')->success($repository->returnToken($user, $tokenInfo));
} }

Loading…
Cancel
Save