送礼加锁处理

This commit is contained in:
2025-09-09 16:15:52 +08:00
parent 49f55dd568
commit 66aee47ba3
2 changed files with 14 additions and 5 deletions

View File

@@ -575,13 +575,19 @@ class GiveGift extends Model
//增加房间火热值hot_value
$gift_totalaa = $gift_total * get_system_config_value('coin_charm_exp');
Db::name('vs_room')
->where(['id' => $from_id, 'apply_status' => 2])
->inc('hot_value', $gift_totalaa)
->inc('today_hot_value', $gift_totalaa)
->update();
// Db::name('vs_room')
// ->where(['id' => $from_id, 'apply_status' => 2])
// ->inc('hot_value', $gift_totalaa)
// ->inc('today_hot_value', $gift_totalaa)
// ->update();
// Db::name('vs_room')->where(['id'=>$from_id,'apply_status'=>2])->setInc('hot_value',$gift_totalaa);
// Db::name('vs_room')->where(['id'=>$from_id,'apply_status'=>2])->setInc('today_hot_value',$gift_totalaa);
$hot_value = db::name('vs_room')->where('id', $from_id)->field('id,hot_value,today_hot_value')->find();
if($hot_value){
$hhot_value = $hot_value['hot_value'] + $gift_totalaa;
$today_hot_value = $hot_value['today_hot_value'] + $gift_totalaa;
db::name('vs_room')->where('id', $hot_value['id'])->update(['hot_value' =>$hhot_value,'today_hot_value'=>$today_hot_value]);
}
$roomtype = Db::name('vs_room')->where(['id' => $from_id])->value('type_id');
if($roomtype == 6){