ActivityCatalog.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Support;
  3. use App\Services\Sharing\ShareDefaults;
  4. /** Activity display categories include hot/other and a single F1 lottery category. */
  5. final class ActivityCatalog
  6. {
  7. public const PUBLISH_PLATFORMS = ['PC', 'H5', 'APP'];
  8. /** 余额宝已独立到 /admin/yuebao/config 维护,不再出现在活动列表中。 */
  9. public const YUEBAO_TYPE = 6;
  10. public static function activityTypes(): array
  11. {
  12. return [2 => '普通活动', 3 => '即充即送', 4 => '老用户召集令', 5 => 'USDT使用教学', 6 => '余额宝'];
  13. }
  14. public static function gameTypes(): array
  15. {
  16. $categories = ShareDefaults::categories();
  17. unset($categories['third:3']);
  18. return ['hot' => '热门'] + $categories + ['other' => '其他'];
  19. }
  20. public static function options(): array
  21. {
  22. $gameTypes = $activityTypes = [];
  23. foreach (self::gameTypes() as $value => $label) {
  24. $gameTypes[] = ['value' => $value, 'label' => $label];
  25. }
  26. foreach (self::activityTypes() as $value => $label) {
  27. if ($value === self::YUEBAO_TYPE) continue;
  28. $activityTypes[] = ['value' => $value, 'label' => $label];
  29. }
  30. return ['game_types' => $gameTypes, 'activity_types' => $activityTypes,
  31. 'click_types' => AnnouncementCatalog::options(AnnouncementCatalog::CLICKS),
  32. 'click_positions' => [['value' => 'cover', 'label' => '活动列表封面'], ['value' => 'detail', 'label' => '活动详情按钮']]];
  33. }
  34. }