| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace app\common\model;
- use think\Model;
- class EmailTemplate extends Model
- {
- protected $name = 'email_template';
- protected $autoWriteTimestamp = false;
- public function getStatusList(): array
- {
- return [
- 0 => '禁用',
- 1 => '启用',
- ];
- }
- public function getTypeList(): array
- {
- return [
- 'subscribe_auto' => '订阅欢迎邮件',
- 'subscribe_manual' => '后台补发邮件',
- 'marketing_broadcast' => '营销群发邮件',
- ];
- }
- public static function getTypeText(string $type): string
- {
- $list = (new static())->getTypeList();
- return $list[$type] ?? $type;
- }
- }
|