|
@@ -51,6 +51,19 @@ class Rebate extends Authenticatable
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ protected function getHuishuiAmountAttribute($value)
|
|
|
|
|
+ {
|
|
|
|
|
+ $value = 0;
|
|
|
|
|
+ $huishui_restriction = Config::where('field', 'huishui_restriction')->first()->val;
|
|
|
|
|
+ $huishui_percentage = Config::where('field', 'huishui_percentage')->first()->val;
|
|
|
|
|
+ $lose = $this->profit * -1;
|
|
|
|
|
+ if ($lose >= $huishui_restriction) {
|
|
|
|
|
+ $value = bcmul($lose, $huishui_percentage, 2); // 返利金额
|
|
|
|
|
+ }
|
|
|
|
|
+ return $value;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
protected function getCreatedAtAttribute($value)
|
|
protected function getCreatedAtAttribute($value)
|
|
|
{
|
|
{
|
|
|
return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
|
|
return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
|