Dan,
I have to apologize. I had forgotten that during some testing we disabled part of our code that would do the actual passing of the dates in ISO format. We re-enabled that part of our code, and the dates do get passed to the form_params correctly. But still the returned response was an empty array and the log shows that the API did not get the dates. So we then tried with the suggested changes to the fromDt and toDt using the Class. But all that did was tell me that the Date class was invalid. So we reverted the change and this is what we see in the log now.
12 66b0d50 2015-11-06 14:45 API GET DEBUG /stats SQL = SELECT stat.type, display.Display, layout.Layout, IFNULL(widgetoption.value, CONCAT(widget.type, '-', widget.widgetId)) AS Name, COUNT(StatID) AS NumberPlays, SUM(TIME_TO_SEC(TIMEDIFF(end, start))) AS Duration, MIN(start) AS MinStart, MAX(end) AS MaxEnd FROM stat INNER JOIN display ON stat.DisplayID = display.DisplayID INNER JOIN layout ON layout.LayoutID = stat.LayoutID LEFT OUTER JOIN `widget` ON `widget`.widgetId = stat.MediaID LEFT OUTER JOIN `widgetoption` ON `widgetoption`.widgetId = `widget`.widgetId AND `widgetoption`.type = 'attrib' AND `widgetoption`.option = 'name' WHERE stat.type <> 'displaydown' AND stat.end > :fromDt AND stat.start <= :toDt AND stat.displayID IN (2,1) GROUP BY stat.type, display.Display, layout.Layout, CONCAT(widget.type, '-', widget.widgetId) ORDER BY stat.type, display.Display, layout.Layout, Name . Params = array ( 'fromDt' => Jenssegers\Date\Date::__set_state(array( 'date' => '2015-11-05 14:45:06', 'timezone_type' => 3, 'timezone' => 'America/Los_Angeles', )), 'toDt' => Jenssegers\Date\Date::__set_state(array( 'date' => '2015-11-06 14:45:06', 'timezone_type' => 3, 'timezone' => 'America/Los_Angeles', )), ).
11 66b0d50 2015-11-06 14:45 API GET DEBUG /stats SQL = SELECT display.displayId, display.display, display.defaultLayoutId, layout.layout AS defaultLayout, display.license, display.licensed, display.licensed AS currentlyLicenced, display.loggedIn, display.lastAccessed, display.isAuditing, display.inc_schedule AS incSchedule, display.email_alert AS emailAlert, display.alert_timeout AS alertTimeout, display.clientAddress, display.mediaInventoryStatus, display.macAddress, display.macAddress AS currentMacAddress, display.lastChanged, display.numberOfMacAddressChanges, display.lastWakeOnLanCommandSent, display.wakeOnLan AS wakeOnLanEnabled, display.wakeOnLanTime, display.broadCastAddress, display.secureOn, display.cidr, X(display.GeoLocation) AS latitude, Y(display.GeoLocation) AS longitude, display.version_instructions AS versionInstructions, display.client_type AS clientType, display.client_version AS clientVersion, display.client_code AS clientCode, display.displayProfileId, display.currentLayoutId, currentLayout.layout AS currentLayout, display.screenShotRequested, display.storageAvailableSpace, display.storageTotalSpace, displaygroup.displayGroupId, displaygroup.description FROM `display` INNER JOIN `lkdisplaydg` ON lkdisplaydg.displayid = display.displayId INNER JOIN `displaygroup` ON displaygroup.displaygroupid = lkdisplaydg.displaygroupid LEFT OUTER JOIN layout ON layout.layoutid = display.defaultlayoutid LEFT OUTER JOIN layout currentLayout ON currentLayout.layoutId = display.currentLayoutId WHERE 1 = 1 AND displaygroup.isDisplaySpecific = 1 ORDER BY display. Params = array ( ).
10 66b0d50 2015-11-06 14:45 API GET DEBUG /stats Converted Times received are: FromDt=2015-11-05 14:45:06. ToDt=2015-11-06 14:45:06
9 66b0d50 2015-11-06 14:45 API GET DEBUG /stats SQL = SELECT `group`.group, `group`.groupId, `group`.isUserSpecific, `group`.isEveryone, `group`.libraryQuota FROM `group` WHERE 1 = 1 AND `group`.groupId IN (SELECT groupId FROM `lkusergroup` WHERE userId = :userId) AND isUserSpecific = :isUserSpecific AND isEveryone = :isEveryone . Params = array ( 'userId' => 1, 'isUserSpecific' => 0, 'isEveryone' => 0, ).
8 66b0d50 2015-11-06 14:45 API GET DEBUG /stats Loading 1. All Objects = 0
7 66b0d50 2015-11-06 14:45 API GET DEBUG /stats SQL = SELECT `user`.userId, userName, userTypeId, loggedIn, email, `user`.homePageId, pages.title AS homePage, lastAccessed, newUserWizard, retired, CSPRNG, UserPassword AS password, group.groupId, group.group, IFNULL(group.libraryQuota, 0) AS libraryQuota FROM `user` INNER JOIN lkusergroup ON lkusergroup.userId = user.userId INNER JOIN `group` ON `group`.groupId = lkusergroup.groupId AND isUserSpecific = 1 LEFT OUTER JOIN `pages` ON pages.pageId = `user`.homePageId WHERE 1 = 1 AND user.userId = :userId ORDER BY userName. Params = array ( 'userId' => 1, ).
The forms_params array output:
array (size=1)
‘form_params’ =>
array (size=4)
‘fromDt’ => string ‘2015-10-01 00:00:00’ (length=19)
‘toDt’ => string ‘2015-11-30 23:59:59’ (length=19)
‘displayId’ => int 1
‘mediaId’ => int 0
The returned repoonse:
string '200 OK' (length=6)
And the actual return from the API:
array (size=0)
empty
So I think I will focus on trying to figure out why the API does not seem to be seeing the dates being passed.
Also just to note, on the code to get the date stats fixed. Can’t remember if the date selection in the CMS within the Alpha and Dev versions of the CMS were working, but they surely do now. However we don’t see any media in the date selections of the CMS:
UPDATE: I no more than got done typing this, and things changed. We decided to reboot everything. The server and the two test units.10 minutes later, we have stats from the api. Although not complete, and still the dates are not being passed. And also the results are not what we are expecting, As I outlined above it doesn’t look like the stats return media. However, I am thinking where “text-1”, and “text-2” are showing, this is actually the two media items we have scheduled on the layout, it is just that the names are not right. We will make a few changes to the schedule and compare the results.
Update 2: Media change on the layout did not change the stats at all. So Text-1 and Text-2 must be unrelated. Or maybe related to this:
Update 3: With the layout problem fixed and updating the client to R57, we now have the correct names on media in the Statistics page. (We also found out that currently you cannot register a R56 device on a 1.8 Dev) All form_params are still non-functional for us; tried the latest Dev code too. (Had to bypass react/qzm, It would not install.)
Sorry for the long post.