Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -44,7 +44,7 @@ class Topic extends Model
|
||||
if($list){
|
||||
foreach ($list as &$item){
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user