本文整理匯總了PHP中Tracking::rememberFrequencyCap方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tracking::rememberFrequencyCap方法的具體用法?PHP Tracking::rememberFrequencyCap怎麽用?PHP Tracking::rememberFrequencyCap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tracking
的用法示例。
在下文中一共展示了Tracking::rememberFrequencyCap方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deliveredAdStatus
/**
* check delivery status and condition of requested flight
*/
public function deliveredAdStatus($adID, $flightWebsite, $flight, $dateRange)
{
$trackingModel = new Tracking();
//kiểm tra độ tuổi
if ($flight->age && !$this->checkAge(json_decode($flight->age), \Input::get('age'))) {
return self::RESPONSE_TYPE_AGE_LIMIT;
}
//kiểm tra giới tính
if ($flight->sex && !$this->checkGender($flight->sex, \Input::get('g'))) {
return self::RESPONSE_TYPE_GENDER_LIMIT;
}
//kiểm tra vị trí địa lí
if ($flight->country && $flight->province && !$this->checkGeo($flight->country, $flight->province)) {
return self::RESPONSE_TYPE_GEO_LIMIT;
}
//kiểm tra frequency capping
/*if( $flight->frequency_cap && (!$this->checkFrequencyCap($flight->id, $flight->frequency_cap) || Cookie::get(md5("FrequencyCap:$flightWebsite->id")) ) ){
return self::RESPONSE_TYPE_FREQUENCY_CAPPED;
}*/
if (!empty($dateRange) && (!$this->checkFrequencyCap($flight, $dateRange) || Cookie::get(md5("FrequencyCap:{$flightWebsite->id}")))) {
return self::RESPONSE_TYPE_FREQUENCY_CAPPED;
}
// TODO : kiểm tra channel
if ($flight->cost_type == 'cpm' || $flight->cost_type == 'cpc') {
$event = Tracking::getTrackingEventType($flight->cost_type);
$overReport = FALSE;
$checkInventory = $this->checkInventory($flight, $flightWebsite, $event, $dateRange);
if ($checkInventory !== TRUE) {
//full inventory trong ngày
// $checkOverInventory = $this->checkOverInventory($flight, $flightWebsite, $event);
// if($checkOverInventory !== TRUE){
return $checkInventory;
// }
// else{
// $overReport = TRUE;
// }
} else {
$checkOvrInventory = $this->checkOverInventory($flight, $flightWebsite, $event);
pr($checkOvrInventory);
if ($checkOvrInventory === TRUE) {
$overReport = TRUE;
}
}
}
// WHEN READY TO DELIVERY
//if( $flight->frequency_cap ){
if (!empty($dateRange)) {
$todayCapped = $trackingModel->getTodayFreCap($flight);
$now = strtotime(date('Y-m-d 00:00:00'));
foreach ($dateRange as $date) {
if (strtotime($date->start) <= $now && strtotime($date->end) >= $now) {
if ($date->frequency_cap > 0 && $todayCapped >= $date->frequency_cap - 1 && $date->frequency_cap_time > 0) {
$trackingModel->rememberFrequencyCap($flightWebsite->id, $date->frequency_cap_time);
$trackingModel->setTimeFreeCap($flight, $date->frequency_cap_time);
}
}
}
/*if( $todayCapped >= $flight->frequency_cap_free && $flight->frequency_cap_time > 0 ){
$trackingModel->rememberFrequencyCap($flightWebsite->id, $flight->frequency_cap_time);
}*/
}
return $overReport ? self::DELIVERY_STATUS_OVER_REPORT : self::DELIVERY_STATUS_OK;
}