File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,21 @@ protected function _beforeSelect(KDatabaseContext $context)
55
55
{
56
56
$ package = $ this ->getMixer ()->getIdentifier ()->package ;
57
57
58
- $ query ->join ($ package .'_tags_relations AS tags_relations ' , 'tags_relations.row = tbl.uuid ' );
59
- $ query ->join ($ package .'_tags AS tags ' , 'tags.tag_id = tags_relations.tag_id ' );
60
- $ query ->where ('tags.slug IN :tag ' );
61
58
62
- if ($ this ->getConfig ()->strict ) {
63
- $ query ->group ('tbl.uuid ' )->having ('COUNT(*) = :tag_count ' )->bind (array ('tag_count ' => count ((array ) $ query ->getParameters ()->tag )));
59
+ if ($ this ->getConfig ()->strict )
60
+ {
61
+ $ tags = KObjectConfig::unbox ($ this ->getConfig ()->tags );
62
+
63
+ for ($ i = 0 ; $ i < count ($ tags ); $ i ++) {
64
+ $ query ->join ("{$ package }_tags_relations AS tags_relations {$ i }" , "tags_relations {$ i }.row = tbl.uuid " )
65
+ ->join ("{$ package }_tags AS tags {$ i }" , "tags {$ i }.tag_id = tags_relations {$ i }.tag_id " , 'INNER ' )
66
+ ->where ("tags {$ i }.slug = :tag {$ i }" )
67
+ ->bind (array ("tag {$ i }" => $ tags [$ i ]));
68
+ }
64
69
}
70
+ else $ query ->join ($ package . '_tags_relations AS tags_relations ' , 'tags_relations{$i}.row = tbl.uuid ' )
71
+ ->join ($ package . '_tags AS tags ' , 'tags.tag_id = tags_relations.tag_id ' )
72
+ ->where ('tags.slug IN :tag ' );
65
73
}
66
74
}
67
75
}
You can’t perform that action at this time.
0 commit comments