|
@@ -12,6 +12,7 @@ use think\db\exception\DataNotFoundException;
|
|
|
use think\db\exception\DbException;
|
|
use think\db\exception\DbException;
|
|
|
use think\db\exception\ModelNotFoundException;
|
|
use think\db\exception\ModelNotFoundException;
|
|
|
use think\model\relation\HasMany;
|
|
use think\model\relation\HasMany;
|
|
|
|
|
+use think\model\relation\HasOne;
|
|
|
|
|
|
|
|
class TreeRecommend extends BaseModel
|
|
class TreeRecommend extends BaseModel
|
|
|
{
|
|
{
|
|
@@ -40,9 +41,9 @@ class TreeRecommend extends BaseModel
|
|
|
self::$get = sys_config('group_award', 135);
|
|
self::$get = sys_config('group_award', 135);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function user(): HasMany
|
|
|
|
|
|
|
+ public function user(): HasOne
|
|
|
{
|
|
{
|
|
|
- return self::hasMany(User::class, 'uid', 'uid')->field('nickname,phone,avatar');
|
|
|
|
|
|
|
+ return $this->HasOne(User::class, 'uid', 'uid');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|