This commit is contained in:
2025-10-20 09:59:39 +08:00
parent e73091cdf3
commit a4858d47fc
2834 changed files with 6510 additions and 438740 deletions

View File

@@ -50,17 +50,18 @@ class UserWallet extends Model
// 1.系统调节 2.充值 3.提现 4.金币转增(送出) 5.每日任务奖励 6.充值返利 7.购买装扮
// 8.礼盒奖励 9.房间补贴 10.购买礼物 11.收礼增加收益 12.工会补贴 13.转赠金币(接收) 14.收益兑换
// 15.首充 16.天降好礼充值 17.退出工会扣款 18.房主收益 19.主持人收益20.发布头条扣除余额,21.公会长收益,22.提现驳回或提现失败返还,23.财富等级奖励金币领取,24.删除关系扣金币
//27.小时榜获得28-新人充值好礼,32-发红包金币29-发红包钻石30-抢红包金币31-抢红包(钻石) 33-红包剩余退回金币34-红包剩余退回(钻石)
if($gift_type == 1){ //1金币2收益钻石
if($in_out_type == 1){//1收入
$in_out_types = [2,5,6,8,13,14,15,16,22,23,26];
$in_out_types = [2,5,6,8,13,14,15,16,22,23,26,27,30,28,33];
}elseif($in_out_type == 2){//2支出
$in_out_types = [4,7,10,17,20,24,25];
$in_out_types = [4,7,10,17,20,24,25,32];
}
}elseif($gift_type == 2){ //1金币2收益钻石
if($in_out_type == 1){//1收入
$in_out_types = [6,9,11,12,18,19,21];
$in_out_types = [6,9,11,12,18,19,21,22,31,28,34];
}elseif($in_out_type == 2){//2支出
$in_out_types = [3,14];
$in_out_types = [3,14,29];
}
}
@@ -106,10 +107,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 +132,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 +140,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];