Karavan擴展使用爲骨幹
應用程序\代碼\本地\法師\ CatalogSearch \型號\資源\默認Magento的搜索模式搜索\ collection.php
查找方法_getSearchEntityIdsSql()並根據需要進行更改。
$words = array();
if(str_word_count($this->_searchQuery)>1){
$words = explode(" ",$this->_searchQuery);
}
$ifValueId = $this->getConnection()->getCheckSql('t2.value_id > 0', 't2.value', 't1.value');
foreach ($tables as $table => $attributeIds) {
foreach($words as $word){
$selects[] = $this->getConnection()->select()
->from(array('t1' => $table), 'entity_id')
->joinLeft(
array('t2' => $table),
$this->getConnection()->quoteInto(
't1.entity_id = t2.entity_id AND t1.attribute_id = t2.attribute_id AND t2.store_id = ?',
$this->getStoreId()),
array()
)
->where('t1.attribute_id IN (?)', $attributeIds)
->where('t1.store_id = ?', 0)
->where($resHelper->getCILike($ifValueId, $word, $likeOptions));
}
if ($selects) {
$likeCond = '(' . join(' and ', $selects) . ')';
}
}
有些是這樣的。
注意:不覆蓋BAse類