EmailSubscribe.php 881 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class EmailSubscribe extends Model
  5. {
  6. protected $name = 'email_subscribe';
  7. protected $autoWriteTimestamp = false;
  8. protected $append = ['privacy_agree_text'];
  9. public function getStatusList(): array
  10. {
  11. return [
  12. 0 => '已取消',
  13. 1 => '已订阅',
  14. 9 => '用户退订',
  15. ];
  16. }
  17. public function getConfirmStatusList(): array
  18. {
  19. return [
  20. 0 => '未确认',
  21. 1 => '已确认',
  22. ];
  23. }
  24. public function getSendStatusList(): array
  25. {
  26. return [
  27. 0 => '未发送',
  28. 1 => '成功',
  29. 2 => '失败',
  30. ];
  31. }
  32. public function getPrivacyAgreeTextAttr($value, $data): string
  33. {
  34. return !empty($data['privacy_agree']) ? '已同意' : '未同意';
  35. }
  36. }