本文整理汇总了PHP中CriteriaCompo::setsort方法的典型用法代码示例。如果您正苦于以下问题:PHP CriteriaCompo::setsort方法的具体用法?PHP CriteriaCompo::setsort怎么用?PHP CriteriaCompo::setsort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CriteriaCompo
的用法示例。
在下文中一共展示了CriteriaCompo::setsort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: b_recent_offers_show
function b_recent_offers_show($options)
{
include_once XOOPS_ROOT_PATH . "/modules/smartpartner/include/common.php";
// Creating the partner handler object
$offer_handler =& smartpartner_gethandler('offer');
$partner_handler =& smartpartner_gethandler('partner');
include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectpermission.php';
$smartpermissions_handler = new SmartobjectPermissionHandler($partner_handler);
$grantedItems = $smartpermissions_handler->getGrantedItems('full_view');
if (!empty($grantedItems)) {
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('partnerid', '(' . implode(', ', $grantedItems) . ')', 'IN'));
$criteria->add(new Criteria('date_pub', time(), '<'));
$criteria->add(new Criteria('date_end', time(), '>'));
$criteria->add(new Criteria('status', _SPARTNER_STATUS_ONLINE));
$criteria->setsort('date_sub');
$criteria->setOrder('DESC');
$criteria->setLimit($options[2]);
$offersObj =& $offer_handler->getObjects($criteria);
$block = array();
if ($offersObj) {
foreach ($offersObj as $offerObj) {
$block['offers'][] = $offerObj->toArray('e');
}
$smartConfig =& smartpartner_getModuleConfig();
//$image_info = smartpartner_imageResize($partnerObj->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']);
if ($options[0] == 1) {
$block['fadeImage'] = 'style="filter:alpha(opacity=20);" onmouseover="nereidFade(this,100,30,5)" onmouseout="nereidFade(this,50,30,5)"';
}
$block['see_all'] = 1;
$block['lang_see_all'] = _MB_SPARTNER_LANG_SEE_ALL_OFFERS;
$block['smartpartner_url'] = SMARTPARTNER_URL;
}
}
return $block;
}