|
@@ -5,6 +5,8 @@ namespace app\common\model\commission;
|
|
|
use app\common\model\User;
|
|
|
use app\common\Enum\AgentType;
|
|
|
use app\common\library\BcMath;
|
|
|
+use app\common\model\commission\Level;
|
|
|
+use app\common\model\commission\Reward;
|
|
|
use think\Model;
|
|
|
class Agent extends Model
|
|
|
{
|
|
@@ -85,6 +87,12 @@ class Agent extends Model
|
|
|
{
|
|
|
return $this->belongsTo(Level::class, 'level', 'level')->field(['level', 'name', 'image', 'commission_rules']);
|
|
|
}
|
|
|
+
|
|
|
+ // 添加蛇形命名的关联方法别名
|
|
|
+ public function level_info()
|
|
|
+ {
|
|
|
+ return $this->levelInfo();
|
|
|
+ }
|
|
|
|
|
|
public function getPendingRewardAttr($value, $data)
|
|
|
{
|
|
@@ -110,9 +118,21 @@ class Agent extends Model
|
|
|
{
|
|
|
return $this->belongsTo(Level::class, 'level_status', 'level');
|
|
|
}
|
|
|
+
|
|
|
+ // 添加蛇形命名的关联方法别名
|
|
|
+ public function level_status_info()
|
|
|
+ {
|
|
|
+ return $this->levelStatusInfo();
|
|
|
+ }
|
|
|
|
|
|
public function upgradeLevel()
|
|
|
{
|
|
|
return $this->belongsTo(Level::class, 'level_status', 'level');
|
|
|
}
|
|
|
+
|
|
|
+ // 添加蛇形命名的关联方法别名
|
|
|
+ public function upgrade_level()
|
|
|
+ {
|
|
|
+ return $this->upgradeLevel();
|
|
|
+ }
|
|
|
}
|