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,21 +63,19 @@ 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()){
|
||||
if (!$item->save()) {
|
||||
DB::rollBack();
|
||||
continue;
|
||||
}
|
||||
DB::commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user