当前位置: 首页>>代码示例>>PHP>>正文


PHP ARSelectFilter::setGrouping方法代码示例

本文整理汇总了PHP中ARSelectFilter::setGrouping方法的典型用法代码示例。如果您正苦于以下问题:PHP ARSelectFilter::setGrouping方法的具体用法?PHP ARSelectFilter::setGrouping怎么用?PHP ARSelectFilter::setGrouping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ARSelectFilter的用法示例。


在下文中一共展示了ARSelectFilter::setGrouping方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSubscriptionStatusImpl

 private function getSubscriptionStatusImpl($forceRecheck)
 {
     if ($this->isRecurring->get() == false) {
         return false;
         // not even a recurring order.
     }
     $rebillsLeft = $this->rebillsLeft->get();
     if ($rebillsLeft == -1 || $rebillsLeft > 0) {
         return self::ACTIVE_SUBSCRIPTION;
     }
     // if order is invoice
     $filter = new ARSelectFilter();
     $filter->setCondition(new EqualsCond(new ARFieldHandle(__CLASS__, 'parentID'), $this->getID()));
     $filter->addField('(SELECT SUM(IF(CustomerOrder.rebillsLeft >= 0, CustomerOrder.rebillsLeft, 0 )))', '', 'rebillsLeft');
     $filter->addField('(SELECT SUM(IF(CustomerOrder.rebillsLeft = -1, 1, 0 )))', '', 'isInfinite');
     $filter->setGrouping(new ARFieldHandle(__CLASS__, 'parentID'));
     $data = ActiveRecordModel::getRecordSetArray(__CLASS__, $filter);
     if (count($data) == 1 && ($data[0]['isInfinite'] > 0 || $data[0]['rebillsLeft'] > 0)) {
         return self::ACTIVE_SUBSCRIPTION;
     }
     return false;
 }
开发者ID:GregerA,项目名称:livecart,代码行数:22,代码来源:CustomerOrder.php

示例2: getOrderArray

 private function getOrderArray(ARSet $orders)
 {
     $orderArray = $orders->toArray();
     $ids = array();
     foreach ($orderArray as $key => $order) {
         $ids[$order['ID']] = $key;
     }
     ClassLoader::import('application.model.order.OrderNote');
     $f = new ARSelectFilter(new INCond(new ARFieldHandle('OrderNote', 'orderID'), empty($ids) ? array(-1) : array_keys($ids)));
     $f->mergeCondition(new EqualsCond(new ARFieldHandle('OrderNote', 'isAdmin'), 1));
     $f->mergeCondition(new EqualsCond(new ARFieldHandle('OrderNote', 'isRead'), 0));
     $f->setGrouping(new ARFieldHandle('OrderNote', 'orderID'));
     $query = new ARSelectQueryBuilder();
     $query->setFilter($f);
     $query->includeTable('OrderNote');
     $query->removeFieldList();
     $query->addField('COUNT(*)', null, 'cnt');
     $query->addField('orderID');
     foreach (ActiveRecordModel::getDataBySQL($query->getPreparedStatement(ActiveRecord::getDBConnection())) as $res) {
         $orderArray[$ids[$res['orderID']]]['unreadMessageCount'] = $res['cnt'];
     }
     return $orderArray;
 }
开发者ID:GregerA,项目名称:livecart,代码行数:23,代码来源:UserController.php

示例3: getActiveDates

 private function getActiveDates()
 {
     $date = date("Y-m-d");
     $f = new ARSelectFilter();
     $f->setCondition(new AndChainCondition(array(gte(f('EyeExamSchedule.date'), $date), isnull(f('EyeExamSchedule.eyeExamRequestID')))));
     $f->setGrouping(f('EyeExamSchedule.date'));
     $f->setLimit(self::ACTIVE_DATES_LIMIT);
     $timeList = ActiveRecordModel::getRecordSetFields('EyeExamSchedule', $f, array('date'));
     // as result is an array of arrays with single value
     $activeTimes = array();
     foreach ($timeList as $id) {
         $activeTimes[] = $id['date'];
     }
     return $activeTimes;
 }
开发者ID:saiber,项目名称:www,代码行数:15,代码来源:EyeExamController.php


注:本文中的ARSelectFilter::setGrouping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。