EmailTemplate.php 723 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class EmailTemplate extends Model
  5. {
  6. protected $name = 'email_template';
  7. protected $autoWriteTimestamp = false;
  8. public function getStatusList(): array
  9. {
  10. return [
  11. 0 => '禁用',
  12. 1 => '启用',
  13. ];
  14. }
  15. public function getTypeList(): array
  16. {
  17. return [
  18. 'subscribe_auto' => '订阅欢迎邮件',
  19. 'subscribe_manual' => '后台补发邮件',
  20. 'marketing_broadcast' => '营销群发邮件',
  21. ];
  22. }
  23. public static function getTypeText(string $type): string
  24. {
  25. $list = (new static())->getTypeList();
  26. return $list[$type] ?? $type;
  27. }
  28. }