| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- namespace frontend\models;
- use Yii;
- /**
- * This is the model class for table "bit_article".
- *
- * @property integer $id
- * @property string $create_date
- * @property string $modify_date
- * @property string $author
- * @property string $content
- * @property integer $down
- * @property integer $hits
- * @property string $image_path
- * @property boolean $is_publication
- * @property boolean $is_recommend
- * @property boolean $is_top
- * @property string $link_url
- * @property string $meta_description
- * @property string $meta_keywords
- * @property string $min_content
- * @property string $sub_title
- * @property string $title
- * @property integer $up
- * @property integer $article_category_id
- * @property string $createdatea
- * @property string $modifydatea
- * @property string $meta_imge
- */
- class Article extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'bit_article';
- }
- public static function getDb()
- {
- return Yii::$app->get('dbXcoq');
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['create_date', 'modify_date', 'createdatea', 'modifydatea'], 'safe'],
- [['content', 'content1','content2','hits', 'title','title1','title2', 'article_category_id'], 'required'],
- [['content', 'content1','content2','min_content'], 'string'],
- [['down', 'hits', 'up', 'article_category_id'], 'integer'],
- [['is_publication', 'is_recommend', 'is_top'], 'boolean'],
- [['author','author1','author2', 'image_path', 'link_url', 'sub_title','sub_title1','sub_title2', 'title', 'title1','title2','meta_imge'], 'string', 'max' => 255],
- [['meta_description', 'meta_keywords'], 'string', 'max' => 3000],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'create_date' => 'Create Date',
- 'modify_date' => 'Modify Date',
- 'author' => 'Author',
- 'content' => 'Content',
- 'down' => 'Down',
- 'hits' => 'Hits',
- 'image_path' => 'Image Path',
- 'is_publication' => 'Is Publication',
- 'is_recommend' => 'Is Recommend',
- 'is_top' => 'Is Top',
- 'link_url' => 'Link Url',
- 'meta_description' => 'Meta Description',
- 'meta_keywords' => 'Meta Keywords',
- 'min_content' => 'Min Content',
- 'sub_title' => 'Sub Title',
- 'title' => 'Title',
- 'up' => 'Up',
- 'article_category_id' => 'Article Category ID',
- 'createdatea' => 'Createdatea',
- 'modifydatea' => 'Modifydatea',
- 'meta_imge' => 'Meta Imge',
- 'sub_title1' => 'Sub Title1',
- 'title1' => 'Title1',
- 'author1' => 'Author1',
- 'content1' => 'Content1',
- 'min_content1' => 'Min_content1',
- 'sub_title2' => 'Sub_title2',
- 'title2' => 'Title2',
- 'author2' => 'Author2',
- 'content2' => 'Content2',
- 'min_content2' => 'Min_content2',
- ];
- }
- // 关联
- public function getCategory()
- {
- return $this->hasOne(ArticleCategory::className(), ['id' => 'article_category_id']);
- }
-
- }
|