本文整理汇总了PHP中Oara_Utilities::numberOfDaysBetweenTwoDates方法的典型用法代码示例。如果您正苦于以下问题:PHP Oara_Utilities::numberOfDaysBetweenTwoDates方法的具体用法?PHP Oara_Utilities::numberOfDaysBetweenTwoDates怎么用?PHP Oara_Utilities::numberOfDaysBetweenTwoDates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oara_Utilities
的用法示例。
在下文中一共展示了Oara_Utilities::numberOfDaysBetweenTwoDates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTransactionList
/**
* (non-PHPdoc)
* @see library/Oara/Network/Oara_Network_Publisher_Interface#getTransactionList($aMerchantIds, $dStartDate, $dEndDate, $sTransactionStatus)
*/
public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
{
$nowDate = new Zend_Date();
$dStartDate = clone $dStartDate;
$dStartDate->setLocale('en');
$dStartDate->setHour("00");
$dStartDate->setMinute("00");
$dStartDate->setSecond("00");
$dEndDate = clone $dEndDate;
$dEndDate->setLocale('en');
$dEndDate->setHour("23");
$dEndDate->setMinute("59");
$dEndDate->setSecond("59");
$valuesFromExport = Oara_Utilities::cloneArray($this->_exportTransactionParameters);
$valuesFromExport[] = new Oara_Curl_Parameter('startDate', $dStartDate->toString("dd-MMM-yyyy"));
$valuesFromExport[] = new Oara_Curl_Parameter('endDate', $dEndDate->toString("dd-MMM-yyyy"));
$transactions = array();
$urls = array();
$urls[] = new Oara_Curl_Request('http://ws-external.afnt.co.uk/apiv1/AFFILIATES/affiliatefuture.asmx/GetTransactionListbyDate?', $valuesFromExport);
$urls[] = new Oara_Curl_Request('http://ws-external.afnt.co.uk/apiv1/AFFILIATES/affiliatefuture.asmx/GetCancelledTransactionListbyDate?', $valuesFromExport);
$exportReport = $this->_client->get($urls);
for ($i = 0; $i < count($urls); $i++) {
$xml = self::loadXml($exportReport[$i]);
if (isset($xml->error)) {
throw new Exception('Error connecting with the server');
}
if (isset($xml->TransactionList)) {
foreach ($xml->TransactionList as $transaction) {
$date = new Zend_Date(self::findAttribute($transaction, 'TransactionDate'), "yyyy-MM-ddTHH:mm:ss");
if (in_array((int) self::findAttribute($transaction, 'ProgrammeID'), $merchantList) && $date->compare($dStartDate) >= 0 && $date->compare($dEndDate) <= 0) {
$obj = array();
$obj['merchantId'] = self::findAttribute($transaction, 'ProgrammeID');
$obj['date'] = $date->toString("yyyy-MM-dd HH:mm:ss");
if (self::findAttribute($transaction, 'TrackingReference') != null) {
$obj['custom_id'] = self::findAttribute($transaction, 'TrackingReference');
}
$obj['unique_id'] = self::findAttribute($transaction, 'TransactionID');
if ($i == 0) {
if (Oara_Utilities::numberOfDaysBetweenTwoDates($date, $nowDate) > 5) {
$obj['status'] = Oara_Utilities::STATUS_CONFIRMED;
} else {
$obj['status'] = Oara_Utilities::STATUS_PENDING;
}
} else {
if ($i == 1) {
$obj['status'] = Oara_Utilities::STATUS_DECLINED;
}
}
$obj['amount'] = self::findAttribute($transaction, 'SaleValue');
$obj['commission'] = self::findAttribute($transaction, 'SaleCommission');
$leadCommission = self::findAttribute($transaction, 'LeadCommission');
if ($leadCommission != 0) {
$obj['commission'] += $leadCommission;
}
$transactions[] = $obj;
}
}
}
}
return $transactions;
}