File: /var/www/platansoft/data/www/platansoft.ru/bitrix/modules/statistic/classes/mysql/adv.php
Line: 567
MySQL Query Error: SELECT A.ID, A.REFERER1, A.REFERER2, A.PRIORITY, A.EVENTS_VIEW, A.DESCRIPTION, A.DATE_FIRST C_TIME_FIRST, A.DATE_LAST C_TIME_LAST, 'RUB' CURRENCY, DATE_FORMAT(A.DATE_FIRST, '%d.%m.%Y') DATE_FIRST, DATE_FORMAT(A.DATE_LAST, '%d.%m.%Y') DATE_LAST, UNIX_TIMESTAMP(ifnull(A.DATE_LAST,0))-UNIX_TIMESTAMP(ifnull(A.DATE_FIRST,0)) ADV_TIME, -- TODAY sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.GUESTS_DAY,0),0)) GUESTS_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.NEW_GUESTS,0),0)) NEW_GUESTS_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.FAVORITES,0),0)) FAVORITES_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.C_HOSTS_DAY,0),0)) C_HOSTS_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.SESSIONS,0),0)) SESSIONS_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.HITS,0),0)) HITS_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.GUESTS_DAY_BACK,0),0)) GUESTS_BACK_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.FAVORITES_BACK,0),0)) FAVORITES_BACK_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.HOSTS_DAY_BACK,0),0)) HOSTS_BACK_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.SESSIONS_BACK,0),0)) SESSIONS_BACK_TODAY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.HITS_BACK,0),0)) HITS_BACK_TODAY, -- YESTERDAY sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.GUESTS_DAY,0),0)) GUESTS_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.NEW_GUESTS,0),0)) NEW_GUESTS_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.FAVORITES,0),0)) FAVORITES_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.C_HOSTS_DAY,0),0)) C_HOSTS_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.SESSIONS,0),0)) SESSIONS_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.HITS,0),0)) HITS_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.GUESTS_DAY_BACK,0),0)) GUESTS_BACK_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.FAVORITES_BACK,0),0)) FAVORITES_BACK_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.HOSTS_DAY_BACK,0),0)) HOSTS_BACK_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.SESSIONS_BACK,0),0)) SESSIONS_BACK_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.HITS_BACK,0),0)) HITS_BACK_YESTERDAY, -- THE DAY BEFORE YESTERDAY sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.GUESTS_DAY,0),0)) GUESTS_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.NEW_GUESTS,0),0)) NEW_GUESTS_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.FAVORITES,0),0)) FAVORITES_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.C_HOSTS_DAY,0),0)) C_HOSTS_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.SESSIONS,0),0)) SESSIONS_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.HITS,0),0)) HITS_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.GUESTS_DAY_BACK,0),0)) GUESTS_BACK_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.FAVORITES_BACK,0),0)) FAVORITES_BACK_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.HOSTS_DAY_BACK,0),0)) HOSTS_BACK_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.SESSIONS_BACK,0),0)) SESSIONS_BACK_BEF_YESTERDAY, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.HITS_BACK,0),0)) HITS_BACK_BEF_YESTERDAY, -- PERIOD A.GUESTS GUESTS_PERIOD, A.C_HOSTS C_HOSTS_PERIOD, A.NEW_GUESTS NEW_GUESTS_PERIOD, A.FAVORITES FAVORITES_PERIOD, A.SESSIONS SESSIONS_PERIOD, A.HITS HITS_PERIOD, A.GUESTS_BACK GUESTS_BACK_PERIOD, A.HOSTS_BACK HOSTS_BACK_PERIOD, A.FAVORITES FAVORITES_BACK_PERIOD, A.SESSIONS_BACK SESSIONS_BACK_PERIOD, A.HITS_BACK HITS_BACK_PERIOD, -- TOTAL A.GUESTS, A.NEW_GUESTS, A.FAVORITES, A.C_HOSTS, A.SESSIONS, A.HITS, A.GUESTS_BACK, A.FAVORITES_BACK, A.HOSTS_BACK, A.SESSIONS_BACK, A.HITS_BACK, -- AUDIENCE if(A.SESSIONS>0,round(A.HITS/A.SESSIONS,2),-1) ATTENT, if(A.SESSIONS_BACK>0,round(A.HITS_BACK/A.SESSIONS_BACK,2),-1) ATTENT_BACK, if(A.GUESTS>0,round((A.NEW_GUESTS/A.GUESTS)*100,2),-1) NEW_VISITORS, if(A.GUESTS>0,round((A.GUESTS_BACK/A.GUESTS)*100,2),-1) RETURNED_VISITORS, if( round((((UNIX_TIMESTAMP(ifnull(A.DATE_LAST,0))-UNIX_TIMESTAMP(ifnull(A.DATE_FIRST,0)))/86400)),0)>=1, round(A.GUESTS/((UNIX_TIMESTAMP(ifnull(A.DATE_LAST,0)) - UNIX_TIMESTAMP(ifnull(A.DATE_FIRST,0)))/86400),2),-1) VISITORS_PER_DAY, -- FINANCES round(round(A.COST,2)*1,2) COST, round(round(A.REVENUE,2)*1,2) REVENUE, round(round(A.REVENUE-A.COST,2)*1,2) BENEFIT, round(round(if(A.SESSIONS>0,A.COST/A.SESSIONS,0),2)*1,2) SESSION_COST, round(round(if(A.GUESTS>0,A.COST/A.GUESTS,0),2)*1,2) VISITOR_COST, if(A.COST>0,round(((A.REVENUE-A.COST)/A.COST)*100,2),-1) ROI FROM b_stat_adv A LEFT JOIN b_stat_adv_day D ON (D.ADV_ID = A.ID) WHERE (1=1) GROUP BY A.ID, A.REFERER1, A.REFERER2, A.COST, A.REVENUE, A.PRIORITY, A.EVENTS_VIEW, A.DESCRIPTION, A.DATE_FIRST, A.DATE_LAST, A.GUESTS, A.NEW_GUESTS, A.FAVORITES, A.C_HOSTS, A.SESSIONS, A.HITS, A.GUESTS_BACK, A.FAVORITES_BACK, A.HOSTS_BACK, A.SESSIONS_BACK, A.HITS_BACK HAVING 1=1 ORDER BY SESSIONS_TODAY desc, SESSIONS_YESTERDAY desc, SESSIONS_BEF_YESTERDAY desc, SESSIONS_PERIOD desc, SESSIONS desc LIMIT 500 [Got error 28 from storage engine]

DB query error.
Please try later.