会员等级

This commit is contained in:
liuchaofu 2024-06-05 23:00:13 +08:00
parent cfed701649
commit 07103bbf65
2 changed files with 8 additions and 2 deletions

View File

@ -60,10 +60,9 @@ class UserLogic extends BaseLogic
public static function info($uid)
{
$data = User::where('id',$uid)
$data = User::with(['userShip'])->where('id',$uid)
->field('avatar,real_name,nickname,account,mobile,sex,login_ip,user_money,total_recharge_amount,user_ship')
->find();
//判断是不是员工
if($data){
$data = $data->toArray();

View File

@ -21,6 +21,13 @@ class User extends BaseModel
protected $deleteTime = 'delete_time';
public function userShip()
{
return $this->hasOne(UserShip::class,'id','user_ship')
// return $this->hasOne(UserShip::class,'user_ship','id')
->bind(['vip_name'=>'title','discount','limit']);
}
/**
* @notes 关联用户授权模型
* @return \think\model\relation\HasOne