From 886a0263d853ee9891e63be46dfdd17a64252252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Fri, 5 Sep 2025 16:23:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=BF=E9=97=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=9C=A8=E6=88=BF?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/UserWallet.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/api/model/UserWallet.php b/application/api/model/UserWallet.php index b6dfd95..10d4e92 100644 --- a/application/api/model/UserWallet.php +++ b/application/api/model/UserWallet.php @@ -106,10 +106,11 @@ class UserWallet extends Model return ['code' => 0, 'msg' => '钻石数量不足', 'data' => null]; } + $ear_exchange_coin = get_system_config_value('coin_exchange_rate'); $data = [ 'user_id' => $uid, 'earnings_num' => $earnings_num, - 'coin_num' => $earnings_num * 10, + 'coin_num' => $earnings_num * $ear_exchange_coin, 'createtime' => time(), ]; //开启事务 @@ -130,7 +131,7 @@ class UserWallet extends Model $account_log[] = [ 'user_id' => $uid, 'money_type' => 1, - 'change_value' => $earnings_num * 10, + 'change_value' => $earnings_num * $ear_exchange_coin, 'remarks' => '收益兑换', 'change_type' => 14, 'createtime' => time(), @@ -138,7 +139,7 @@ class UserWallet extends Model ]; $re = db::name('vs_user_money_log')->insertAll($account_log); $re1 = db::name('user_wallet')->where('user_id',$uid)->setDec('earnings',$earnings_num); - $re2 = db::name('user_wallet')->where('user_id',$uid)->setInc('coin',$earnings_num * 10); + $re2 = db::name('user_wallet')->where('user_id',$uid)->setInc('coin',$earnings_num * $ear_exchange_coin); if($re && $re1 && $re2){ db::commit(); return ['code' => 1, 'msg' => '兑换成功', 'data' => null];