예제 #1
0
 public function getChildren()
 {
     if ($this->_children == 1) {
         if (!($_children = ProductCategory::find()->where(['parent_id' => $this->id])->andWhere(['is_active' => 1])->orderBy('position asc')->all())) {
             $_children = [];
         }
         $this->_children = $_children;
     }
     return $this->_children;
 }
예제 #2
0
 public function findAllCategory()
 {
     $category = ProductCategory::find()->all();
     return $category;
 }