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,20 +63,18 @@ class CheckCommission extends Command
|
|||||||
->where('invite_user_id', '!=', NULL)
|
->where('invite_user_id', '!=', NULL)
|
||||||
->get();
|
->get();
|
||||||
foreach ($order as $item) {
|
foreach ($order as $item) {
|
||||||
DB::beginTransaction();
|
|
||||||
$inviter = User::find($item->invite_user_id);
|
$inviter = User::find($item->invite_user_id);
|
||||||
if (!$inviter) continue;
|
if (!$inviter) continue;
|
||||||
$inviter->commission_balance = $inviter->commission_balance + $item->commission_balance;
|
$inviter->commission_balance = $inviter->commission_balance + $item->commission_balance;
|
||||||
if (!$inviter->save()) {
|
DB::beginTransaction();
|
||||||
DB::rollBack();
|
if ($inviter->save()) {
|
||||||
continue;
|
$item->commission_status = 2;
|
||||||
|
if (!$item->save()) {
|
||||||
|
DB::rollBack();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
}
|
}
|
||||||
$item->commission_status = 2;
|
|
||||||
if (!$item->save()){
|
|
||||||
DB::rollBack();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
DB::commit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user