|
|
@@ -11,6 +11,10 @@ class Rebate extends BaseModel
|
|
|
'amount', 'status', 'first_name', 'username', 'audited_by',
|
|
|
'profit', 'huishui_percentage', 'huishui_restriction', 'huishui_amount',
|
|
|
];
|
|
|
+ const STATUS_WEI_FAN_YONG = 0;//未返佣
|
|
|
+ const STATUS_FAN_YONG = 1; //已返佣
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
static function updateProfit($data)
|
|
|
@@ -41,7 +45,7 @@ class Rebate extends BaseModel
|
|
|
|
|
|
protected function getHuishuiRestrictionAttribute($value)
|
|
|
{
|
|
|
- if ($this->status == 0) {
|
|
|
+ if ($this->status == static::STATUS_WEI_FAN_YONG) {
|
|
|
$huishui_restriction = Config::where('field', 'huishui_restriction')->first()->val;
|
|
|
return $huishui_restriction;
|
|
|
}
|
|
|
@@ -51,7 +55,7 @@ class Rebate extends BaseModel
|
|
|
|
|
|
protected function getHuishuiPercentageAttribute($value)
|
|
|
{
|
|
|
- if ($this->status == 0) {
|
|
|
+ if ($this->status == static::STATUS_WEI_FAN_YONG) {
|
|
|
$huishui_percentage = Config::where('field', 'huishui_percentage')->first()->val;
|
|
|
return $huishui_percentage;
|
|
|
}
|
|
|
@@ -60,7 +64,7 @@ class Rebate extends BaseModel
|
|
|
|
|
|
protected function getHuishuiAmountAttribute($value)
|
|
|
{
|
|
|
- if ($this->status == 0) {
|
|
|
+ if ($this->status == static::STATUS_WEI_FAN_YONG) {
|
|
|
$value = 0;
|
|
|
$huishui_restriction = Config::where('field', 'huishui_restriction')->first()->val;
|
|
|
$huishui_percentage = Config::where('field', 'huishui_percentage')->first()->val;
|