Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2025-09-05 16:39:02 +08:00
2 changed files with 5 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ class Topic extends Model
if($list){ if($list){
foreach ($list as &$item){ foreach ($list as &$item){
$item['content'] = $this->where(['id'=>$item['topic_id']])->value('content'); $item['content'] = $this->where(['id'=>$item['topic_id']])->value('content');
$item['pic'] = $this->where(['id'=>$item['topic_id']])->value('pic'); $item['pic'] = $this->where(['id'=>$item['topic_id']])->value('pic') ?? get_system_config_value('web_site').'/data/avatar/head_pic.png';;
$item['title'] = $this->where(['id'=>$item['topic_id']])->value('title'); $item['title'] = $this->where(['id'=>$item['topic_id']])->value('title');
} }
} }

View File

@@ -106,10 +106,11 @@ class UserWallet extends Model
return ['code' => 0, 'msg' => '钻石数量不足', 'data' => null]; return ['code' => 0, 'msg' => '钻石数量不足', 'data' => null];
} }
$ear_exchange_coin = get_system_config_value('coin_exchange_rate');
$data = [ $data = [
'user_id' => $uid, 'user_id' => $uid,
'earnings_num' => $earnings_num, 'earnings_num' => $earnings_num,
'coin_num' => $earnings_num * 10, 'coin_num' => $earnings_num * $ear_exchange_coin,
'createtime' => time(), 'createtime' => time(),
]; ];
//开启事务 //开启事务
@@ -130,7 +131,7 @@ class UserWallet extends Model
$account_log[] = [ $account_log[] = [
'user_id' => $uid, 'user_id' => $uid,
'money_type' => 1, 'money_type' => 1,
'change_value' => $earnings_num * 10, 'change_value' => $earnings_num * $ear_exchange_coin,
'remarks' => '收益兑换', 'remarks' => '收益兑换',
'change_type' => 14, 'change_type' => 14,
'createtime' => time(), 'createtime' => time(),
@@ -138,7 +139,7 @@ class UserWallet extends Model
]; ];
$re = db::name('vs_user_money_log')->insertAll($account_log); $re = db::name('vs_user_money_log')->insertAll($account_log);
$re1 = db::name('user_wallet')->where('user_id',$uid)->setDec('earnings',$earnings_num); $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){ if($re && $re1 && $re2){
db::commit(); db::commit();
return ['code' => 1, 'msg' => '兑换成功', 'data' => null]; return ['code' => 1, 'msg' => '兑换成功', 'data' => null];