1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "{{%email_record}}".
- *
- * @property int $id ID
- * @property string $address 邮箱地址
- * @property string $title 标题
- * @property string $content 内容
- * @property string $remarks 备注
- * @property string $error 错误记录
- * @property int $type 短信类型 1:系统 2:自定义
- * @property int $sent_time 发送时间
- */
- class EmailRecord extends \app\common\models\EActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%email_record}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['address', 'content'], 'required'],
- [['content', 'remarks'], 'string'],
- [['type', 'sent_time'], 'integer'],
- [['address'], 'string', 'max' => 50],
- [['title', 'error'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => Yii::t('attr','email_record.id'),
- 'address' => Yii::t('attr','email_record.address'),
- 'title' => Yii::t('attr','email_record.title'),
- 'content' =>Yii::t('attr','email_record.content'),
- 'remarks' => Yii::t('attr','email_record.remarks'),
- 'error' =>Yii::t('attr','email_record.error'),
- 'type' => Yii::t('attr','email_record.type'),
- 'sent_time' => Yii::t('attr','email_record.sent_time'),
- ];
- }
- public static function typeOptions($k=null)
- {
- $options = array('1'=>'验证码','2'=>'通用');
- if(is_numeric($k))return $options[$k];
- return $options;
- }
- }
|