当前位置: 首页>>代码示例>>PHP>>正文


PHP Tracking::makeChecksumHash方法代码示例

本文整理汇总了PHP中Tracking::makeChecksumHash方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::makeChecksumHash方法的具体用法?PHP Tracking::makeChecksumHash怎么用?PHP Tracking::makeChecksumHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracking的用法示例。


在下文中一共展示了Tracking::makeChecksumHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: adsProcess


//.........这里部分代码省略.........
                                                 if ($deliveryStatus == Delivery::DELIVERY_STATUS_OVER_REPORT) {
                                                     $data['ovr'] = $isOverReport = true;
                                                 }
                                                 $responseType = Delivery::RESPONSE_TYPE_ADS_SUCCESS;
                                                 // update number show retargeting
                                                 $url = $flight->retargeting_url;
                                                 if ($url != "") {
                                                     $campaign = $deliveryModel->getCampaign($flight->campaign_id);
                                                     $tracking = new Tracking();
                                                     $key = "Retargeting:{$campaign->advertiser_id}:{$tracking->getVisitorId()}";
                                                     $cache = RedisHelper::get($key);
                                                     if (isset($cache->{$url})) {
                                                         $keyNumberTarget = "RetargetingNumber:{$campaign->advertiser_id}:{$flight->id}:{$flight->ad_id}:{$tracking->getVisitorId()}";
                                                         $cacheNumberTarget = RedisHelper::get($keyNumberTarget);
                                                         if ($cacheNumberTarget) {
                                                             RedisHelper::increment($keyNumberTarget);
                                                         } else {
                                                             RedisHelper::set($keyNumberTarget, 1);
                                                         }
                                                     }
                                                 }
                                                 break;
                                             }
                                         }
                                     }
                                 }
                                 //endforeach
                             }
                             //no ads available
                             if ($responseType != Delivery::RESPONSE_TYPE_ADS_SUCCESS) {
                                 $responseType = Delivery::RESPONSE_TYPE_NOT_AVAILABLE;
                             }
                         } else {
                             $responseType = Delivery::RESPONSE_TYPE_REFERRER_NOT_MATCH;
                         }
                     }
                 }
             }
         }
     }
     //invalid ads request
     if (empty($responseType)) {
         $responseType = Delivery::RESPONSE_TYPE_INVALID;
     } elseif ($responseType == Delivery::RESPONSE_TYPE_ADS_SUCCESS) {
         $expandFields = array('flight_id' => $flightWebsite->flight_id, 'ad_format_id' => $adZone->ad_format_id, 'ad_id' => $flight->ad_id, 'campaign_id' => $flight->campaign_id, 'publisher_ad_zone_id' => $adZone->id, 'flight_website_id' => $flightWebsite->id, 'website_id' => $flightWebsite->website_id);
         if ($isOverReport) {
             $expandFields['ovr'] = 1;
         }
         $expandFields['checksum'] = $checksum = $trackingModel->makeChecksumHash($flightWebsite->id, $trackingModel->created_at);
         $eventChecksum = Delivery::RESPONSE_TYPE_ADS_SUCCESS;
         $trackingModel->setChecksumTrackingEvent($checksum, Delivery::RESPONSE_TYPE_ADS_SUCCESS);
         (new RawTrackingSummary())->addSummary('ads_request', $flightWebsite->website_id, $adZone->id, $adZone->ad_format_id, $flightWebsite->flight_id, $flightWebsite->id, $flight->ad_id, $flight->campaign_id);
     }
     //serve Ad
     // if(0){
     if (!empty($serveAd)) {
         View::addLocation(base_path() . '/frontend/theme/default/views/delivery');
         if (isset($data['ec'])) {
             if ($data['ec'] == 1) {
                 $data['checksum'] = $expandFields['checksum'];
                 $this->data['data'] = $data;
                 $data['type'] = $serveAd->ad_view ? $serveAd->ad_view : strtolower($data['type']);
                 if (Input::get('test') == 1) {
                     return View::make($data['type'], $this->data);
                 } else {
                     $response = Response::view($data['type'], $this->data)->header('Content-Type', 'text/javascript; charset=UTF-8');
                 }
             } else {
                 $response = $vast->makeVAST($data['aid'], $data['fpid'], $data['zid'], $expandFields['checksum'], $isOverReport);
             }
         }
     } else {
         //TO DO : return backup ads
         if (!empty($adZone)) {
             $alternateAds = $deliveryModel->getAlternateAds($adZone->id);
             if (isset($adZone) && $alternateAds) {
                 if (isset($data['ec']) && !$data['ec']) {
                     $response = $vast->makeEmptyVast();
                 } else {
                     $this->data['listAlternateAd'] = $alternateAds;
                     $this->data['zid'] = $adZone->id;
                     View::addLocation(base_path() . '/frontend/theme/default/views/delivery');
                     $response = Response::view('rotator', $this->data)->header('Content-Type', 'text/javascript; charset=UTF-8');
                 }
             } else {
                 if (isset($data['ec']) && !$data['ec']) {
                     $response = $vast->makeEmptyVast();
                 }
             }
             (new RawTrackingSummary())->addSummaryRequestEmptyAd($adZone->id, $adZone->ad_format_id, $websiteID);
         }
     }
     //ghi log process
     $trackingModel->logAfterProcess($responseType, $expandFields, $logPreProcess);
     //response to client
     $endProcess = microtime(1);
     pr($deliveryStatus);
     pr($responseType, 1);
     return $response;
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:101,代码来源:DeliveryController.php


注:本文中的Tracking::makeChecksumHash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。