BaseService.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  46. * 微信公众号菜菜单系统类型
  47. * name: getWechatMenuSystemType
  48. * @return \string[][]
  49. * date 2023/07/11 11:00
  50. */
  51. public static function getWechatMenuSystemType(): array
  52. {
  53. return [
  54. ['value' => 'android', 'name' => "安卓"],
  55. ['value' => 'ios', 'name' => "苹果"],
  56. ];
  57. }
  58. }