| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace addons\WechatVideoShop\common\models;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_wechat_video_shop_cate".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $status 状态[1启用 0禁用 -1删除]
- * @property int $created_at 创建时间
- * @property int $updated_at 更新事件
- * @property string $name 类目名称
- * @property int $pid 上级ID
- * @property int $level 类目级别
- * @property int $shop_id 类目级别
- * @property array $product 类目资质信息
- * @property array $qua 资质信息
- * @property array $product_qua 商品资质信息
- */
- class WechatVideoShopCate extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_wechat_video_shop_cate';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'status', 'created_at', 'updated_at', 'pid', 'level', 'shop_id'], 'integer'],
- [['product', 'qua', 'product_qua'], 'required'],
- [['product', 'qua', 'product_qua'], 'safe'],
- [['name'], 'string', 'max' => 50],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'name' => 'Name',
- 'pid' => 'Pid',
- 'level' => 'Level',
- 'product' => 'Product',
- 'qua' => 'Qua',
- 'product_qua' => 'Product Qua',
- ];
- }
- /**
- * 获取上级
- * @return \yii\db\ActiveQuery
- */
- public function getParent()
- {
- return $this->hasOne(self::class, ['id' => 'pid']);
- }
- public function getChildren()
- {
- return $this->hasMany(self::class, ['pid' => 'id']);
- }
- }
|