44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
|
|
<?
|
||
|
|
|
||
|
|
namespace controller\themes\merakomis\day;
|
||
|
|
|
||
|
|
use ms\ms\structure\msControllerTable;
|
||
|
|
use themes\merakomis\Day;
|
||
|
|
use themes\merakomis\Emp;
|
||
|
|
use themes\merakomis\structure\merakomisControllerTable;
|
||
|
|
|
||
|
|
class Api extends merakomisControllerTable {
|
||
|
|
|
||
|
|
static $class = 'themes\merakomis\Day';
|
||
|
|
|
||
|
|
|
||
|
|
public function getStat(){
|
||
|
|
$res = [];
|
||
|
|
if(Emp::$IS_AUTH){
|
||
|
|
$res = Day::getStat($_POST['year']);
|
||
|
|
}
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function getTableData($post = []) {
|
||
|
|
$post['options'][\Query::COUNT] = 0;
|
||
|
|
$post['options'][\Query::SORT] = [Day::$DATE=>'ASC'];
|
||
|
|
if(isset($post['data']['year'])){
|
||
|
|
$post['options'][\Query::WHERE] = \Where::_operator(Day::$DATE,'LIKE',intval($post['data']['year']).'%');
|
||
|
|
}
|
||
|
|
$post['getData'] = true;
|
||
|
|
$res = parent::getTableData($post);
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
static function getByRange(){
|
||
|
|
$res = [];
|
||
|
|
if(Emp::$IS_AUTH){
|
||
|
|
$res = Day::getByRangeFormatted($_POST['begin'],$_POST['end']);
|
||
|
|
}
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|