mybonus.php remove medal

This commit is contained in:
xiaomlove
2022-12-19 19:01:22 +08:00
parent 55fed75e97
commit b99ca57321
9 changed files with 65 additions and 26 deletions

View File

@@ -55,6 +55,9 @@ class BonusRepository extends BaseRepository
if ($exists) {
throw new \LogicException("user: $uid already own this medal: $medalId.");
}
if ($medal->get_type != Medal::GET_TYPE_EXCHANGE) {
throw new \LogicException("This medal can not be buy.");
}
$requireBonus = $medal->price;
NexusDB::transaction(function () use ($user, $medal, $requireBonus) {
$comment = nexus_trans('bonus.comment_buy_medal', [