| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\common\model;
- use think\Model;
- class EmailSubscribe extends Model
- {
- protected $name = 'email_subscribe';
- protected $autoWriteTimestamp = false;
- protected $append = ['privacy_agree_text'];
- public function getStatusList(): array
- {
- return [
- 0 => '已取消',
- 1 => '已订阅',
- 9 => '用户退订',
- ];
- }
- public function getConfirmStatusList(): array
- {
- return [
- 0 => '未确认',
- 1 => '已确认',
- ];
- }
- public function getSendStatusList(): array
- {
- return [
- 0 => '未发送',
- 1 => '成功',
- 2 => '失败',
- ];
- }
- public function getPrivacyAgreeTextAttr($value, $data): string
- {
- return !empty($data['privacy_agree']) ? '已同意' : '未同意';
- }
- }
|