| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace common\models;
- /**
- * This is the model class for table "xhGoodsCategory".
- *
- * @property integer $id
- * @property integer $gId
- * @property integer $cId
- * @property integer $merchantId
- * @property integer $inTurn
- */
- class xhGoodsCategory extends xhBaseModel
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'xhGoodsCategory';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['gId', 'cId', 'merchantId', 'inTurn'], 'integer'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'gId' => 'G ID',
- 'cId' => 'C ID',
- 'merchantId' => 'Merchant ID',
- 'inTurn' => 'In Turn',
- ];
- }
- public function getXhGoods()
- {
- // 关系和商品通过 Goods.id -> gId 关联建立一对一关系
- return $this->hasOne(xhGoods::className(), ['id' => 'gId']);
- }
- }
|