$user->level) throw new StatusException(ResultStatusServices::RS_PARAM_ERROR); //领取物品 for ($i = 1; $i <= 4; $i++) { if (!isset($itemConfig['fruit_id' . $i])) continue; MoneyUtil::parseItem($itemConfig['fruit_id' . $i], 1, true, $userID, SystemLogUtil::FROM_TYPE_PLAYER_LEVEL_GIFT, ['config' => $itemConfig]); } $levelGift = new LevelGift(); $levelGift->user_id = $userID; $levelGift->gift_id = $giftID; if (!$levelGift->save()) throw new StatusException(ResultStatusServices::RS_SAVE_DB_ERROR); }, [$userID, $giftID], RedisKeyUtil::lockPlayerLevelGift($userID)); }, [$userID, $giftID]); } }