酒吧房加测试代码判断
This commit is contained in:
@@ -1177,7 +1177,6 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
|
||||
// 批量更新库存
|
||||
ksort($inventory_updates); // 按ID排序
|
||||
foreach ($inventory_updates as $detail_id => $count) {
|
||||
Db::name('vs_gift_bag_detail')->where('id',$detail_id)->lock(true)->find(); // 先查并加锁
|
||||
$result = db::name("vs_gift_bag_detail")
|
||||
->where('id',$detail_id)
|
||||
->where('remaining_number', '>=', $count) // 确保库存充足
|
||||
|
||||
@@ -149,6 +149,11 @@ class Decorate extends Model
|
||||
*
|
||||
*/
|
||||
public function pay_decorate($uid, $did, $day=0,$from_type=1,$give_uid=0,$log_remark="",$num=1){
|
||||
if(empty($day) && $from_type == 12){
|
||||
$day = 0;
|
||||
}else{
|
||||
$day = db::name('vs_decorate_price')->where(['did'=>$did])->order('day asc')->value('day');
|
||||
}
|
||||
if(empty($log_remark)){
|
||||
$log_remark = $this->FromType[$from_type];
|
||||
}
|
||||
|
||||
@@ -373,6 +373,9 @@ class Guild extends Model
|
||||
|
||||
//退出公会
|
||||
public function quit_guild($uid, $guild_id,$type){
|
||||
//去除字符里的g
|
||||
$guild_id = str_replace('g', '', $guild_id);
|
||||
$guild_id = intval($guild_id);
|
||||
$config = get_system_config();
|
||||
$user_info = db::name('user')->find($uid);
|
||||
if(!$user_info){
|
||||
|
||||
@@ -56,9 +56,9 @@ class Tasks extends Model
|
||||
public function dailyTasksList($user_id=''){
|
||||
$reslut = [];
|
||||
//用户今日充值金币数量
|
||||
$user_gold = Db::name('vs_user_money_log')->where(['user_id'=>$user_id,'change_type'=>2,'money_type'=>1])
|
||||
$user_gold = Db::name('user_coin_log')->where(['user_id'=>$user_id,'change_type'=>2])
|
||||
->whereTime('createtime', 'today')
|
||||
->sum('change_value');
|
||||
->sum('coin');
|
||||
$reslut['user_gold'] = $user_gold ? $user_gold : 0;
|
||||
//礼盒列表
|
||||
$gift_box = Db::name('vs_gift_bag')->where('status',1)->where('activities_id',2)->select();
|
||||
|
||||
Reference in New Issue
Block a user