コード例 #1
0
    private function setSqlDateRange(Gpf_SqlBuilder_WhereClause $where, $transactionTableAlias = 't') {
        if ($this->getDate() == Pap_Features_PerformanceRewards_Rule::DATE_ALL_UNPAID_COMMISSIONS) {
            $where->add($transactionTableAlias.'.'.Pap_Db_Table_Transactions::PAYOUT_STATUS, '=', Pap_Common_Constants::PSTATUS_UNPAID);
        }

        //TODO: implement - use dateRange object
        //$where->addDateRange($transactionTableAlias.'.'.Pap_Db_Table_Transactions::DATE_INSERTED, $dateRange);
        
        $dateRange = $this->getDateRange(new Gpf_DateTime());
        if($dateRange->isAllTime()) {
            return;
        }
        $where->add($transactionTableAlias.'.'.Pap_Db_Table_Transactions::DATE_INSERTED, '>=', $dateRange->getFrom()->toDateTime());
        $where->add($transactionTableAlias.'.'.Pap_Db_Table_Transactions::DATE_INSERTED, '<=', $dateRange->getTo()->toDateTime());
    }
コード例 #2
0
 private function setStatusWhere(Gpf_SqlBuilder_WhereClause $where) {
     $where->add(self::TRANSACTION_ALIAS.'.'.Pap_Db_Table_Transactions::R_STATUS, 'IN', $this->getStatuses());
 }
コード例 #3
0
 private function initVisitsWhere(Gpf_SqlBuilder_WhereClause $where) {
     $visitorCondition = new Gpf_SqlBuilder_CompoundWhereCondition();
     $visitorCondition->add(Pap_Db_Table_Visits::VISITORID, '=', $this->visitorId);
     if ($this->ip != '') {
         $visitorCondition->add(Pap_Db_Table_Visits::IP, '=', $this->ip, 'OR');
     }
     $where->addCondition($visitorCondition);
     
     $accountCondition = new Gpf_SqlBuilder_CompoundWhereCondition();
     $accountCondition->add(Pap_Db_Table_Visits::ACCOUNTID, '=', $this->accountId);
     if ($this->accountId == Gpf_Db_Account::DEFAULT_ACCOUNT_ID) { 
         $accountCondition->add(Pap_Db_Table_Visits::ACCOUNTID, '=', '', 'OR');
     }
     $where->addCondition($accountCondition);
     
     $where->add(Pap_Db_Table_Visits::DATEVISIT, '<=', $this->toDate->toDateTime());
 }
コード例 #4
0
ファイル: Main.class.php プロジェクト: AmineCherrai/rostanvo
    private function addActionConditionsToWhere(Gpf_SqlBuilder_WhereClause $where, $commissionTypeId, $prefix = '') {
		$where->add($prefix . Pap_Db_Table_Transactions::R_TYPE, '=', Pap_Common_Constants::TYPE_ACTION);
		$where->add($prefix . Pap_Db_Table_Transactions::COMMISSIONTYPEID, '=', $commissionTypeId);
    }
コード例 #5
0
 private function addDatePresetTo(Gpf_SqlBuilder_WhereClause $whereClause)
 {
     $datePreset = $this->decodeDatePreset($this->value);
     if ($datePreset != null) {
         $whereClause->add($this->code, '>=', $datePreset["dateFrom"]);
         $whereClause->add($this->code, '<=', $datePreset["dateTo"]);
     }
 }