本文整理汇总了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;
}