Club System

This commit is contained in:
2026-06-02 20:54:08 +02:00
parent d79dbecad4
commit f4dc336c88
13 changed files with 371 additions and 40 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace RomhackPlaza\Master\Api\Controller;
use XF\Api\Controller\AbstractController;
use XF\Mvc\Reply\AbstractReply;
class EntryController extends AbstractController
{
public function actionPostUpdateEntryCount(): AbstractReply
{
$userId = $this->filter('user_id', 'uint');
$count = $this->filter('count', 'uint');
$user = $this->assertRecordExists('XF:User', $userId);
$user->rhpz_entry_count = $count;
$user->save();
$trophyRepo = $this->repository('XF:Trophy');
$trophyRepo->updateTrophiesForUser($user);
return $this->apiSuccess(['success' => true,'user_id' => $user->user_id,'count' => $count]);
}
}