File: /sites/numizmat.net/www/bitrix/modules/statistic/classes/mysql/stateventtype.php
Line: 224
MySQL Query Error: SELECT E.ID, E.EVENT1, E.EVENT2, E.COUNTER, E.DIAGRAM_DEFAULT, 'RUR' CURRENCY, DATE_FORMAT(E.DATE_ENTER, '%d.%m.%Y %H:%i:%s') DATE_ENTER, DATE_FORMAT(max(D.DATE_LAST), '%d.%m.%Y %H:%i:%s') DATE_LAST, max(ifnull(D.DATE_LAST,'1980-01-01')) E_DATE_LAST, sum(ifnull(D.COUNTER,0))+ifnull(E.COUNTER,0) TOTAL_COUNTER, sum(round(ifnull(D.MONEY,0)*1,2))+round(ifnull(E.MONEY,0)*1,2) TOTAL_MONEY, sum(if(to_days(curdate())=to_days(D.DATE_STAT),ifnull(D.COUNTER,0),0)) TODAY_COUNTER, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.COUNTER,0),0)) YESTERDAY_COUNTER, sum(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.COUNTER,0),0)) B_YESTERDAY_COUNTER, sum(0) PERIOD_COUNTER, sum(round(if(to_days(curdate())-to_days(D.DATE_STAT)=0,ifnull(D.MONEY,0),0)*1,2)) TODAY_MONEY, sum(round(if(to_days(curdate())-to_days(D.DATE_STAT)=1,ifnull(D.MONEY,0),0)*1,2)) YESTERDAY_MONEY, sum(round(if(to_days(curdate())-to_days(D.DATE_STAT)=2,ifnull(D.MONEY,0),0)*1,2)) B_YESTERDAY_MONEY, sum(round(0*1,2)) PERIOD_MONEY, E.NAME, E.DESCRIPTION, if (length(E.NAME)>0, E.NAME, concat(E.EVENT1,' / ',ifnull(E.EVENT2,''))) EVENT FROM b_stat_event E LEFT JOIN b_stat_event_day D ON (D.EVENT_ID = E.ID) WHERE (1=1) GROUP BY E.ID HAVING '1'='1' ORDER BY TODAY_COUNTER desc, YESTERDAY_COUNTER desc, B_YESTERDAY_COUNTER desc, TOTAL_COUNTER desc, PERIOD_COUNTER desc LIMIT 5000 [Table './numizmat/b_stat_event_day' is marked as crashed and last (automatic?) repair failed]