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