diff --git a/application/api/model/UserWallet.php b/application/api/model/UserWallet.php index 67aa4891..e351f835 100644 --- a/application/api/model/UserWallet.php +++ b/application/api/model/UserWallet.php @@ -137,9 +137,17 @@ class UserWallet extends Model $ear_exchange_coin = get_system_config_value('coin_exchange_rate'); $coin_num = $earnings_num * $ear_exchange_coin; + + $data = [ + 'user_id' => $uid, + 'earnings_num' => $earnings_num, + 'coin_num' => $earnings_num * $ear_exchange_coin, + 'createtime' => time(), + ]; //开启事务 db::startTrans(); try{ + $give_gift_id = db::name('user_exchange')->insertGetId($data); $earn = $this->change_user_earnings_log($uid,$earnings_num,0,14,'收益兑换'); $coin = $this->change_user_cion_log($uid,$coin_num,0,14,'收益兑换'); if($earn === true && $coin === true){