/** * * 获取经纪人套餐,竞价点击 * * @param $brokerId * @param $cityId * @param $siteType * @param $isBidCity * * @return array */ public static function getBrokerSevenClick($brokerId, $cityId, $siteType, $isBidCity = true) { $startDate = date('Y-m-d', time() - 86400 * 7); $endDate = date('Y-m-d', time()); //今日套餐、竞价点击 $result['today_click'] = array(); //套餐近7日的点击 $siteTypeArr = array('ajk' => Model_Ppc_NewPackageStatsBrokerDay::SITE_TYPE_AJK, 'hz' => Model_Ppc_NewPackageStatsBrokerDay::SITE_TYPE_HZ, 'jp' => Model_Ppc_NewPackageStatsBrokerDay::SITE_TYPE_JP); $comboClick = Bll_Combo_Broker_BrokerComboInfo::getBrokerComboClick($brokerId, date('Y-m-d', time() - 86400 * 7), date('Y-m-d', time()), $siteTypeArr[$siteType]); $bidClick = array(); if ($isBidCity) { //竞价近7日的点击 if ($siteType == 'ajk') { $bidClick = Bll_Combo_Broker_BrokerComboInfo::getBrokerBidClickAjk($brokerId, $cityId, $startDate, $endDate); } elseif ($siteType == 'hz') { $bidClick = Bll_Combo_Broker_BrokerComboInfo::getBrokerBidClickHz($brokerId, $cityId, $startDate, $endDate); } elseif ($siteType == 'jp') { $bidClick = Bll_Combo_Broker_BrokerComboInfo::getBrokerBidClickJp($brokerId, $startDate, $endDate); } } $today_click = array(); $seven_days_click = array(); $Time = time(); for ($i = 6; $i >= 0; $i--) { $tmpTime = $Time - $i * 86400; $tmpComboClick = isset($comboClick[date('Ymd', $tmpTime)]['cnum']) ? $comboClick[date('Ymd', $tmpTime)]['cnum'] : 0; $tmpBidClick = isset($bidClick[date('Ymd', $tmpTime)]) ? $bidClick[date('Ymd', $tmpTime)] : 0; if (date('Ymd') == date('Ymd', $tmpTime)) { //今日点击 $today_click['combo'] = $tmpComboClick; if ($isBidCity) { $today_click['bidding'] = $tmpBidClick; } } $seven_days_click[date('m-d', $tmpTime)]['combo'] = $tmpComboClick; if ($isBidCity) { $seven_days_click[date('m-d', $tmpTime)]['bidding'] = $tmpBidClick; } } return array('today_click' => $today_click, 'seven_days_click' => $seven_days_click); }