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


PHP KSSystem::getYaMarketData方法代码示例

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


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

示例1: getShopStatisticByPlacesFull

 public function getShopStatisticByPlacesFull($fromDate, $toDate, $groupBy)
 {
     $this->onExecuteBefore('getShopStatisticByPlacesFull', array(&$fromDate, &$toDate, &$groupBy));
     if (!empty($this->_sid) && $this->_sid > 0) {
         $fromDate = new DateTime($fromDate);
         $fromDate = $fromDate->format('d-m-Y');
         $toDate = new DateTime($toDate);
         $toDate = $toDate->format('d-m-Y');
         $function = array('campaigns', $this->_sid, 'stats', 'main-' . $groupBy);
         $params = array('fromDate' => $fromDate, 'toDate' => $toDate, 'byPlaces' => 1);
         $statistic = KSSystem::getYaMarketData($function, 'GET', $params);
         if ($statistic && count($statistic->mainStats) > 0) {
             //$statistic          = $this->setShopStatisticPlaces($statistic->mainStats);
             $statistic_group = new stdClass();
             $total->{3}['clicks'] = 0;
             $total->{3}['spending'] = 0;
             $total->{4}['clicks'] = 0;
             $total->{4}['spending'] = 0;
             $total->{5}['clicks'] = 0;
             $total->{5}['spending'] = 0;
             $total->{6}['clicks'] = 0;
             $total->{6}['spending'] = 0;
             foreach ($statistic->mainStats as $stat) {
                 $date = date("d.m.Y", strtotime($stat->date));
                 $statistic_group->{$date}->{$stat->placeGroup}['clicks'] = $stat->clicks;
                 $statistic_group->{$date}->{$stat->placeGroup}['spending'] = $stat->spending;
                 $total->{$stat->placeGroup}['clicks'] += $stat->clicks;
                 $total->{$stat->placeGroup}['spending'] += $stat->spending;
                 if (!isset($statistic_group->{$date}->{3})) {
                     $statistic_group->{$date}->{3}['clicks'] = 0;
                     $statistic_group->{$date}->{3}['spending'] = 0;
                 }
                 if (!isset($statistic_group->{$date}->{4})) {
                     $statistic_group->{$date}->{4}['clicks'] = 0;
                     $statistic_group->{$date}->{4}['spending'] = 0;
                 }
                 if (!isset($statistic_group->{$date}->{5})) {
                     $statistic_group->{$date}->{5}['clicks'] = 0;
                     $statistic_group->{$date}->{5}['spending'] = 0;
                 }
                 if (!isset($statistic_group->{$date}->{6})) {
                     $statistic_group->{$date}->{6}['clicks'] = 0;
                     $statistic_group->{$date}->{6}['spending'] = 0;
                 }
                 $statistic_group->{$date}->totalClicks += $stat->clicks;
                 $statistic_group->{$date}->totalSpending += $stat->spending;
                 $total->totalSpending += $stat->spending;
                 $total->totalClicks += $stat->clicks;
             }
             $statistic_group->km_total = $total;
             $this->onExecuteAfter('getShopStatisticByPlacesFull', array(&$statistic_group));
             return $statistic_group;
         }
     }
     return new stdClass();
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:56,代码来源:yamarket.php


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