Update UserRebateService.php

This commit is contained in:
邹景立 2021-03-26 16:31:40 +08:00
parent 4aba900abb
commit c5e3650679

View File

@ -23,7 +23,9 @@ class UserRebateService extends Service
$count = $this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>0")->sum('amount');
$total = $this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=1 and deleted=0")->sum('amount');
$locks = $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(['rebate_total' => $total, 'rebate_used' => $count, 'rebate_lock' => $locks]);
$this->app->db->name('DataUser')->where(['id' => $uuid])->update([
'rebate_total' => $total, 'rebate_used' => $count, 'rebate_lock' => $locks,
]);
} else {
$count = $this->app->db->name('DataUserTransfer')->whereRaw("status>0")->sum('amount');
$total = $this->app->db->name('DataUserRebate')->whereRaw("status=1 and deleted=0")->sum('amount');