Esempio n. 1
0
 protected function _ignoreIncrease(RM_Points_Account $obAccount, RM_User_Family_Object $obPerson)
 {
     return count($obAccount->getPaymentList()->filter('event=? and family_id=? and date_format(amount_date,?) = date_format(now(),?)', $this->_name, $obPerson->id(), '%Y', '%Y')) > 0;
 }
Esempio n. 2
0
 protected function _isNotUnique(RM_Points_Account $obAccount, $bdate)
 {
     $checkEvents = array('new-barcode', 'no-new-barcode');
     return count($obAccount->getPaymentList()->filter('event in (' . sqlBinds($checkEvents) . ')', $checkEvents)->filter('amount_date=?', M('Date')->dbDate($bdate))) > 0;
 }
Esempio n. 3
0
 public function _calculateUserCollection(RM_Points_Account $obAccount, $minDate, $maxDate)
 {
     static $query;
     if (!$query) {
         $query = M('Db')->createQuery($this->table('payment') . ' p');
         $query->what('sum(amount) as total');
     }
     $query->where()->reset();
     $query->where('p.account_id=? and p.cdate>=? and p.cdate<?', $obAccount->id(), $minDate, $maxDate);
     foreach ($query->execute() as $row) {
         return $row['total'];
     }
     return NULL;
 }
Esempio n. 4
0
 protected function _isAlreadyAwarded(RM_Points_Account $obAccount, $bdate)
 {
     $checkEvents = array('scanning', 'no-purchase');
     return count($obAccount->getPaymentList()->filter('event in (' . sqlBinds($checkEvents) . ')', $checkEvents)->filter('amount_date=?', $bdate)) > 0;
 }
Esempio n. 5
0
 /**
  * Retrievs a list of payments for account with my event types  
  *
  * @param	RM_Points_Account $obAccount
  * @return	RM_Store_iRequest<RM_Points_Payment>
  */
 protected function _getEventPaymentList(RM_Points_Account $obAccount)
 {
     return $obAccount->getPaymentList()->filter('event=?', $this->_name);
 }