BaseService.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. *
  4. * @file:BaseService.php
  5. * @Date: 2023/6/7
  6. * @Time: 14:28
  7. */
  8. namespace Modules\Common\Services;
  9. use Catch\Exceptions\FailedException;
  10. class BaseService
  11. {
  12. public static function getMiniProgramType()
  13. {
  14. return [
  15. ['value' => 1, 'name' => "微信小程序"],
  16. ['value' => 2, 'name' => "抖音小程序"],
  17. ];
  18. }
  19. public static function getNavPagesType()
  20. {
  21. return [
  22. ['value' => 1, 'name' => "排行榜"],
  23. ['value' => 2, 'name' => "最新"],
  24. ];
  25. }
  26. public static function throwErrMsg($msg, $code = "")
  27. {
  28. if ($code) {
  29. throw new FailedException($msg, $code);
  30. }
  31. throw new FailedException($msg);
  32. }
  33. /**
  34. * 微信公众号关键字类型
  35. * name: getWechatKeywordType
  36. * @return \string[][]
  37. * date 2023/07/05 16:34
  38. */
  39. public static function getWechatKeywordType(){
  40. return [
  41. ['value' => 'txt', 'name' => "纯文本"],
  42. ['value' => 'miniprogram', 'name' => "小程序"],
  43. ];
  44. }
  45. }