mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update: commission
This commit is contained in:
parent
fe736df68d
commit
1ce019cfa5
@ -63,14 +63,11 @@ class CheckCommission extends Command
|
||||
->where('invite_user_id', '!=', NULL)
|
||||
->get();
|
||||
foreach ($order as $item) {
|
||||
DB::beginTransaction();
|
||||
$inviter = User::find($item->invite_user_id);
|
||||
if (!$inviter) continue;
|
||||
$inviter->commission_balance = $inviter->commission_balance + $item->commission_balance;
|
||||
if (!$inviter->save()) {
|
||||
DB::rollBack();
|
||||
continue;
|
||||
}
|
||||
DB::beginTransaction();
|
||||
if ($inviter->save()) {
|
||||
$item->commission_status = 2;
|
||||
if (!$item->save()) {
|
||||
DB::rollBack();
|
||||
@ -79,5 +76,6 @@ class CheckCommission extends Command
|
||||
DB::commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user