| @@ 10-22 (lines=13) @@ | ||
| 7 | */ |
|
| 8 | class FacetModificationPropertyIterator extends FacetPropertyIterator |
|
| 9 | {
|
|
| 10 | protected function getCriteria($productIdList) |
|
| 11 | {
|
|
| 12 | $criteria = new CDbCriteria(); |
|
| 13 | $criteria->select = CMap::mergeArray(array('t.id'), $this->propertyList);
|
|
| 14 | $criteria->distinct = true; |
|
| 15 | $criteria->join = 'JOIN '.Yii::app()->db->schema->quoteTableName($this->assignmentTable).' AS a ON a.product_id = t.parent'; |
|
| 16 | $criteria->addCondition('NOT t.parent IS NULL');
|
|
| 17 | ||
| 18 | if( !is_null($productIdList) ) |
|
| 19 | $criteria->addInCondition('t.id', $productIdList);
|
|
| 20 | ||
| 21 | return $criteria; |
|
| 22 | } |
|
| 23 | } |
|
| @@ 56-68 (lines=13) @@ | ||
| 53 | * |
|
| 54 | * @return CDbCriteria |
|
| 55 | */ |
|
| 56 | protected function getCriteria($productIdList) |
|
| 57 | {
|
|
| 58 | $criteria = new CDbCriteria(); |
|
| 59 | $criteria->select = CMap::mergeArray(array('t.id'), $this->propertyList);
|
|
| 60 | $criteria->distinct = true; |
|
| 61 | $criteria->join = 'JOIN '.Yii::app()->db->schema->quoteTableName($this->assignmentTable).' AS a ON a.product_id = t.id'; |
|
| 62 | $criteria->addCondition('t.parent IS NULL');
|
|
| 63 | ||
| 64 | if( !is_null($productIdList) ) |
|
| 65 | $criteria->addInCondition('t.id', $productIdList);
|
|
| 66 | ||
| 67 | return $criteria; |
|
| 68 | } |
|
| 69 | } |
|