2017-09-19, 22:17:27
(2017-09-19, 18:22:13)Bigin Wrote: Hi angelo,
thanks.
Here was an issue when selecting "SimpleItem" objects. Therefore I recommend you to pull ItemManager from Github master repository https://github.com/bigin/ItemManager_2.0. Or just download the ZIP file from master and upgrade your installed version to the new one. Upgrading from one version of ItemManager to another is a matter of replacing these files and directories from your old version, and putting in fresh copies from the new version:
/plugins/imanager/ (complete folder)
/plugins/imanager.php (file)
For complex queries that contain multiple selectors (more than 2, there you use 3) is recommended to split them into several parts, here's an example:
PHP Code:$activeItems = $itemMapper->getSimpleItems('active=1');
$resultItems = $itemMapper->getSimpleItems('mydate>1504216800 && mydate<1506895140', 0, 0, $activeItems);
Please also note the following, if you want to select SimpleItems within a specific date, including the date you have written in your selector example, then you should use ">=" and "<=" operators. So your query should then look like this:
PHP Code:$activeItems = $itemMapper->getSimpleItems('active=1');
$resultItems = $itemMapper->getSimpleItems('mydate>=1504216800 && mydate<=1506895140', 0, 0, $activeItems);
Wau .... thank you. worked perfect
...but when add $start and $end parameter getSimpleItems() not work
PHP Code:
$month = 9;
$year = 2017;
$start = mktime(0, 0, 1, $month, 1, $year);
$end = mktime(23, 59, 00, $month, date('t', $month), $year);
$activeItems = $itemMapper->getSimpleItems('active=1');
$resultItems = $itemMapper->getSimpleItems('mydate>='.$start.'&& mydate<='.$end, 0, 0, $activeItems);
$items = $itemMapper->filterSimpleItems('mydate', 'ASC','' ,'',$resultItems);