123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "wz_mobile_msg_tpl".
- *
- * @property int $id ID
- * @property string $key KEY
- * @property string $name 名称
- * @property string $code 模板编号
- * @property string $tpl 模板内容
- * @property string $args 参数
- * @property int $type 1:验证码 2:通知
- */
- class MobileMsgTpl extends \app\common\models\EActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%mobile_msg_tpl}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['key','name','code','tpl','type'], 'required'],
- [['type'], 'integer'],
- [['key', 'name', 'code'], 'string', 'max' => 50],
- [['tpl', 'args'], 'string', 'max' => 500],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => Yii::t('attr','mobile_msg_tpl.id'),
- 'key' => Yii::t('attr','mobile_msg_tpl.key'),
- 'name' => Yii::t('attr','mobile_msg_tpl.name'),
- 'code' => Yii::t('attr','mobile_msg_tpl.code'),
- 'tpl' => Yii::t('attr','mobile_msg_tpl.tpl'),
- 'args' => Yii::t('attr','mobile_msg_tpl.args'),
- 'type' => Yii::t('attr','mobile_msg_tpl.type')
- ];
- }
- public static function typeOptions($k=null)
- {
- $options = array('1'=>'验证码','2'=>'通用');
- if(is_numeric($k))return $options[$k];
- return $options;
- }
- }
|