1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "{{%tag}}".
- *
- * @property int $id ID
- * @property string $tag 标签
- * @property string $url 固定连接,否则系统自动生成tag连接
- * @property int $quote_num 被引用次数
- * @property int $user_id 添加者
- * @property int $recommend 推荐
- * @property string $seo_title 标题
- * @property string $seo_keywords 关键词
- * @property string $seo_description 描述
- * @property string $pinyin 标签拼音
- * @property int|null $disabled 1:禁用
- * @property int $create_time 添加时间
- */
- class Tag extends \app\common\models\EActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%tag}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['tag', 'create_time'], 'required'],
- [['quote_num', 'user_id', 'recommend', 'disabled', 'create_time'], 'integer'],
- // [['tag'], 'string', 'max' => 50],
- [['url', 'seo_title', 'seo_keywords', 'pinyin'], 'string', 'max' => 300],
- [['seo_description'], 'string', 'max' => 500],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => Yii::t('attr','tag.id'),
- 'tag' => Yii::t('attr','tag.tag'),
- 'url' => Yii::t('attr','tag.url'),
- 'quote_num' => Yii::t('attr','tag.quote_num'),
- 'user_id' => Yii::t('attr','tag.user_id'),
- 'recommend' => Yii::t('attr','tag.recommend'),
- 'seo_title' => Yii::t('attr','tag.seo_title'),
- 'seo_keywords' => Yii::t('attr','tag.seo_keywords'),
- 'seo_description' => Yii::t('attr','tag.seo_description'),
- 'pinyin' => Yii::t('attr','tag.pinyin'),
- 'disabled' => Yii::t('attr','tag.disabled'),
- 'create_time' => Yii::t('attr','tag.create_time')
- ];
- }
- }
|