|
@@ -25,13 +25,13 @@ class Rebate extends Authenticatable
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
- static function updateProfit($data): void
|
|
|
|
|
|
|
+ static function updateProfit($data)
|
|
|
{
|
|
{
|
|
|
$data['date'] = Carbon::now('America/New_York')->format('Y-m-d');
|
|
$data['date'] = Carbon::now('America/New_York')->format('Y-m-d');
|
|
|
$rebate = static::where('date', $data['date'])
|
|
$rebate = static::where('date', $data['date'])
|
|
|
->where('member_id', $data['member_id'])->first();
|
|
->where('member_id', $data['member_id'])->first();
|
|
|
$rebate->increment('profit', $data['profit']);
|
|
$rebate->increment('profit', $data['profit']);
|
|
|
-
|
|
|
|
|
|
|
+ return $rebate;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static function addOrUpdate($data)
|
|
static function addOrUpdate($data)
|