45], [['pic_url', 'big_pic_url', 'advert_pic', 'advert_url',], 'string', 'max' => 255], [['advert_open_type'], 'string', 'max' => 65], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => 'Mall ID', 'mch_id' => 'Mch ID', 'parent_id' => 'Parent ID', 'name' => 'Name', 'pic_url' => 'Pic Url', 'sort' => 'Sort', 'is_show' => 'Is Show', 'big_pic_url' => 'Big Pic Url', 'advert_pic' => 'Advert Pic', 'advert_url' => 'Advert Url', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'deleted_at' => 'Deleted At', 'is_delete' => 'Is Delete', 'advert_open_type' => '打开方式', 'advert_params' => '导航参数', ]; } public function getMallGoods() { return $this->hasMany(MallGoods::className(), ['id' => 'goods_warehouse_id']) ->viaTable(GoodsCatRelation::tableName(), ['cat_id' => 'id', 'is_delete' => 'is_delete']); } public function getGoods() { return $this->hasMany(GoodsWarehouse::className(), ['id' => 'goods_warehouse_id']) ->viaTable(GoodsCatRelation::tableName(), ['cat_id' => 'id'])->where(['is_delete' => 0]); } public function getParent() { return $this->hasOne(GoodsCats::className(), ['id' => 'parent_id']); } public function getChild() { return $this->hasMany(GoodsCats::className(), ['parent_id' => 'id'])->andWhere(['is_delete' => 0]); } public function getGoodsCatRelation() { return $this->hasMany(GoodsCatRelation::className(), ['cat_id' => 'id']) ->where(['is_delete' => 0]); } }