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']); } }