mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-21 22:39:16 +08:00
修改余额
This commit is contained in:
parent
19b7ff8f7c
commit
afb4828477
@ -74,7 +74,7 @@ class UserBalance extends Controller
|
||||
protected function _form_filter(array &$data)
|
||||
{
|
||||
if (empty($data['code'])) {
|
||||
$data['code'] = CodeExtend::uniqidDate('16', 'B');
|
||||
$data['code'] = CodeExtend::uniqidDate('20', 'B');
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$data['create_by'] = AdminService::instance()->getUserId();
|
||||
|
@ -93,8 +93,8 @@ class UserUpgradeService extends Service
|
||||
*/
|
||||
public function syncBalance(int $uuid, array $nots = []): array
|
||||
{
|
||||
$total = abs($this->app->db->name('DataUserBalance')->where("uid='{$uuid}' and status=1 and amount>0 and deleted=0")->sum('amount'));
|
||||
$count = abs($this->app->db->name('DataUserBalance')->where("uid='{$uuid}' and status=1 and amount<0 and deleted=0")->sum('amount'));
|
||||
$total = abs($this->app->db->name('DataUserBalance')->where("uid='{$uuid}' and amount>0 and deleted=0")->sum('amount'));
|
||||
$count = abs($this->app->db->name('DataUserBalance')->where("uid='{$uuid}' and amount<0 and deleted=0")->sum('amount'));
|
||||
if (empty($nots)) {
|
||||
$this->app->db->name('DataUser')->where(['id' => $uuid])->update(['balance_total' => $total, 'balance_used' => $count]);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user