如果我有一个有4000行的表
<table>
<tr class="a b c d e f g"><td>xxx</td></tr>
<tr class="a c d e f g"><td>xxx</td></tr>
<tr class="d e f g"><td>xxx</td></tr>
<tr class="a d e f g"><td>xxx</td></tr>
.
.
.
.
.
</table>
Run Code Online (Sandbox Code Playgroud)
如果我想选择具有类(a或b或c)和(d或e)和(a或g)的行
如何编写选择器语句?
谢谢
我想通过getLoadedProductCollection进行排序.
对于产品属性,我有一个自定义属性'featured_product'
这是我的代码:
$sort=$_GET['s'];
$_productCollection=$this->getLoadedProductCollection()->addAttributeToSelect('featured_product');
$_productCollection->clear();
$_productCollection->getSelect()->reset(Zend_Db_Select::ORDER);
switch($sort)
{
case 'lp':
$_productCollection->addAttributeToSort('price', 'ASC');
break;
case 'hp':
$_productCollection->addAttributeToSort('price', 'DESC');
break;
case 'fp':
$_productCollection->addAttributeToSort('featured_product');
break;
}
Run Code Online (Sandbox Code Playgroud)
对于前两种情况,它没有问题.
但第三个根本不起作用.
我想将所有特色产品移到收藏列表的开头.
如何更改实现第三种情况的代码?
谢谢