|
@@ -11,6 +11,7 @@ use crmeb\traits\ModelTrait;
|
|
|
use think\db\exception\DataNotFoundException;
|
|
|
use think\db\exception\DbException;
|
|
|
use think\db\exception\ModelNotFoundException;
|
|
|
+use think\model\relation\HasMany;
|
|
|
|
|
|
class TreeRecommend extends BaseModel
|
|
|
{
|
|
@@ -31,11 +32,17 @@ class TreeRecommend extends BaseModel
|
|
|
|
|
|
use ModelTrait;
|
|
|
|
|
|
+
|
|
|
public function __construct(array $data = [])
|
|
|
{
|
|
|
parent::__construct($data);
|
|
|
- self::$layers = 12;
|
|
|
- self::$get = 130;
|
|
|
+ self::$layers = sys_config('group_layer', 12);
|
|
|
+ self::$get = sys_config('group_award', 135);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function user(): HasMany
|
|
|
+ {
|
|
|
+ return self::hasMany(User::class, 'uid', 'uid')->field('nickname,phone,avatar');
|
|
|
}
|
|
|
|
|
|
|