NoticeSetting.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\common\model;
  20. use think\model\concern\SoftDelete;
  21. class NoticeSetting extends BaseModel
  22. {
  23. use SoftDelete;
  24. protected $deleteTime = 'delete_time';
  25. protected $name = 'dev_notice_setting';
  26. /**
  27. * @notes 通知类型描述获取器
  28. * @param $value
  29. * @return string
  30. * @author Tab
  31. * @date 2021/8/18 16:37
  32. */
  33. public function getTypeDescAttr($value)
  34. {
  35. $desc = [
  36. 1 => '业务通知',
  37. 2 => '验证码',
  38. ];
  39. return $desc[$value] ?? '';
  40. }
  41. /**
  42. * @notes 接收者描述获取器
  43. * @param $value
  44. * @return string
  45. * @author Tab
  46. * @date 2021/8/18 16:42
  47. */
  48. public function getRecipientDescAttr($value)
  49. {
  50. $desc = [
  51. 1 => '买家',
  52. 2 => '卖家',
  53. ];
  54. return $desc[$value] ?? '';
  55. }
  56. /**
  57. * @notes 系统通知获取器
  58. * @param $value
  59. * @return array|mixed
  60. * @author Tab
  61. * @date 2021/8/18 19:11
  62. */
  63. public function getSystemNoticeAttr($value)
  64. {
  65. return empty($value) ? [] : json_decode($value, true);
  66. }
  67. /**
  68. * @notes 短信通知获取器
  69. * @param $value
  70. * @return array|mixed
  71. * @author Tab
  72. * @date 2021/8/18 19:12
  73. */
  74. public function getSmsNoticeAttr($value)
  75. {
  76. return empty($value) ? [] : json_decode($value, true);
  77. }
  78. /**
  79. * @notes 公众号通知获取器
  80. * @param $value
  81. * @return array|mixed
  82. * @author Tab
  83. * @date 2021/8/18 19:13
  84. */
  85. public function getOaNoticeAttr($value)
  86. {
  87. return empty($value) ? [] : json_decode($value, true);
  88. }
  89. /**
  90. * @notes 小程序通知获取器
  91. * @param $value
  92. * @return array|mixed
  93. * @author Tab
  94. * @date 2021/8/18 19:13
  95. */
  96. public function getMnpNoticeAttr($value)
  97. {
  98. return empty($value) ? [] : json_decode($value, true);
  99. }
  100. }