public function getAttributeCategory() { return ProductAttributeCategory::softFind()->select('product_attribute_category.*')->leftJoin(ProductAttribute::tableName(), '`product_attribute_category`.`id` = `product_attribute`.`category_id`')->leftJoin(ProductAttributeAssignment::tableName(), '`product_attribute_assignment`.`attribute_id` = `product_attribute`.`id`')->leftJoin(static::tableName(), '`product`.`id` = `product_attribute_assignment`.`product_id`')->where(['product.id' => $this->id]); }
$form = ActiveForm::begin(); ?> <?php if ($productAttributeCategory = ProductAttributeCategory::softFind()->andWhere(['id' => $categoryId])->one()) { ?> <?php } elseif ($model->product->attributeCategory) { ?> <?php $productAttributeCategory = $model->product->attributeCategory; ?> <?php } else { ?> <?php $productAttributeCategory = ProductAttributeCategory::softFind()->one(); ?> <?php } ?> <?php $assignmentProductIdMap = $model->product->attributeAssignmentsAttributeIdMap; ?> <div class="col-md-12 update-attributes"> <table class="table table-striped table-bordered"> <thead> <tr> <td width="10%" colspan="5"> <div class="row"> <div class="col-md-2 col-md-offset-1"> <style>