mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update UserRebateService.php
This commit is contained in:
parent
22db40f324
commit
ccf431caae
@ -23,9 +23,7 @@ class UserRebateService extends Service
|
|||||||
$count = abs($this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>0")->sum('amount'));
|
$count = abs($this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>0")->sum('amount'));
|
||||||
$total = abs($this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=1 and deleted=0")->sum('amount'));
|
$total = abs($this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=1 and deleted=0")->sum('amount'));
|
||||||
$locks = abs($this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=0 and deleted=0")->sum('amount'));
|
$locks = abs($this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=0 and deleted=0")->sum('amount'));
|
||||||
$this->app->db->name('DataUser')->where(['id' => $uuid])->update([
|
$this->app->db->name('DataUser')->where(['id' => $uuid])->update(['rebate_total' => $total, 'rebate_used' => $count, 'rebate_lock' => $locks]);
|
||||||
'rebate_total' => $total, 'rebate_used' => $count, 'rebate_lock' => $locks,
|
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
$count = abs($this->app->db->name('DataUserTransfer')->whereRaw("status>0")->sum('amount'));
|
$count = abs($this->app->db->name('DataUserTransfer')->whereRaw("status>0")->sum('amount'));
|
||||||
$total = abs($this->app->db->name('DataUserRebate')->whereRaw("status=1 and deleted=0")->sum('amount'));
|
$total = abs($this->app->db->name('DataUserRebate')->whereRaw("status=1 and deleted=0")->sum('amount'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user