where('GameID', 4020) ->where('Stock', '>=', $limitValue) ->get(); if ($list->isNotEmpty()) { foreach ($list as $value) { DB::table(TableName::QPPlatformDB() . 'RoomStockStatic') ->where('ID', $value->ID) ->decrement('Stock', $decValue); } } } }