| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace common\models;
- /**
- * This is the model class for table "xhArticleCategory".
- *
- * @property integer $id
- * @property integer $aId
- * @property integer $cId
- * @property integer $merchantId
- */
- class xhArticleCategory extends xhBaseModel
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'xhArticleCategory';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['aId', 'cId', 'merchantId'], 'integer']
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'aId' => 'A ID',
- 'cId' => 'C ID',
- 'merchantId' => 'Merchant ID',
- ];
- }
-
- public function getXhArticle()
- {
- // 关系和文章通过 article.id -> aId 关联建立一对一关系
- return $this->hasOne(xhArticle::className(), ['id' => 'aId']);
- }
- }
|