1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "wz_mobile_msg".
- *
- * @property int $id ID
- * @property string $mobile 手机号
- * @property string $title 标题
- * @property string $content 内容
- * @property string $remarks 备注
- * @property string $error 错误记录
- * @property int $type 短信类型 1:验证码 2:普通内容
- * @property int $sent_time 发送时间
- * @property int $real_sent_time 真实发送时间(如定时发送)
- */
- class MobileMsg extends \app\common\models\EActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%mobile_msg}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mobile', 'content', 'remarks'], 'required'],
- [['content', 'remarks'], 'string'],
- [['type', 'sent_time', 'real_sent_time'], 'integer'],
- [['mobile'], 'string', 'max' => 20],
- [['title', 'error'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => Yii::t('attr','mobile_msg.id'),
- 'mobile' => Yii::t('attr','mobile_msg.mobile'),
- 'title' => Yii::t('attr','mobile_msg.title'),
- 'content' => Yii::t('attr','mobile_msg.content'),
- 'remarks' => Yii::t('attr','mobile_msg.remarks'),
- 'error' => Yii::t('attr','mobile_msg.error'),
- 'type' => Yii::t('attr','mobile_msg.type'),
- 'sent_time' => Yii::t('attr','mobile_msg.sent_time'),
- 'real_sent_time' => Yii::t('attr','mobile_msg.real_sent_time'),
- ];
- }
- public static function typeOptions($k=null)
- {
- $options = array('1'=>'验证码','2'=>'通用');
- if(is_numeric($k))return $options[$k];
- return $options;
- }
- }
|