Skip to content

Commit

Permalink
修改月贴/水榜为数据库查询
Browse files Browse the repository at this point in the history
  • Loading branch information
zxy19 committed Oct 1, 2024
1 parent 3c95d2b commit c9430b6
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 23 deletions.
19 changes: 12 additions & 7 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@
use Flarum\Api\Controller\ListUsersController;
use Flarum\User\Filter\UserFilterer;
use Illuminate\Database\Eloquent\Builder;
use Nodeloc\LeaderBoard\Listeners\DateChange;
use Xypp\LocalizeDate\Event\DateChangeEvent;

return [
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
->js(__DIR__ . '/js/dist/admin.js'),

(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/resources/less/forum.less')
->js(__DIR__ . '/js/dist/forum.js')
->css(__DIR__ . '/resources/less/forum.less')
->route('/leaderboard', 'nodeloc_leaderboard', Content\LeaderBoard::class),

new Extend\Locales(__DIR__.'/resources/locale'),
new Extend\Locales(__DIR__ . '/resources/locale'),

(new Extend\ApiSerializer(ForumSerializer::class))
->attributes(PermissionBasedForumSettings::class),
Expand All @@ -34,16 +36,19 @@
->listen(Posted::class, [Listeners\UpdateCount::class, 'postWasPosted'])
->listen(Started::class, [Listeners\UpdateCount::class, 'discussionWasStarted'])
->listen(PostDeleted::class, [Listeners\UpdateCount::class, 'postWasDeleted'])
->listen(DiscussionDeleted::class, [Listeners\UpdateCount::class, 'discussionWasDeleted']),
->listen(DiscussionDeleted::class, [Listeners\UpdateCount::class, 'discussionWasDeleted'])
->listen(DateChangeEvent::class, DateChange::class),
(new Extend\View())
->namespace('nodeloc.leaderboard', __DIR__.'/resources/views'),
->namespace('nodeloc.leaderboard', __DIR__ . '/resources/views'),
(new Extend\ApiController(ListUsersController::class))
->addSortField('money')
->addSortField('lotteryCount')
->addSortField('bestAnswerCount')
->addSortField('lastCheckinMoney')
->addSortField('monthlyDiscussionCount')
->addSortField('monthlyCommentCount'),
->addSortField('monthlyCommentCount')
->addSortField('lastMonthlyDiscussionCount')
->addSortField('lastMonthlyCommentCount'),
(new Extend\Settings())
->default('nodeloc-leaderboard.admin.settings.link', false)
->default('nodeloc-leaderboard.default-sort', 'default'),
Expand Down
2 changes: 1 addition & 1 deletion js/dist/admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c9430b6

Please sign in to comment.