33 lines
929 B
PHP
33 lines
929 B
PHP
|
|
<?
|
||
|
|
|
||
|
|
namespace controller\core\user\account;
|
||
|
|
|
||
|
|
class Api extends \core\core\structure\ControllerTable {
|
||
|
|
static $class = '\Account';
|
||
|
|
|
||
|
|
function reg(){
|
||
|
|
echo je(\Account::reg($_POST));
|
||
|
|
}
|
||
|
|
function login(){
|
||
|
|
echo je(\Account::login($_POST['login'],$_POST['pass']));
|
||
|
|
}
|
||
|
|
function exit(){
|
||
|
|
\Account::exit();
|
||
|
|
echo je(array());
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function getNameList() {
|
||
|
|
$res = [];
|
||
|
|
if(\Account::$isSuper || IF_AUTH) {
|
||
|
|
$q = (string)trim($_POST['q']);
|
||
|
|
$res = \Account::getNameList([
|
||
|
|
\Query::WHERE => new \Where(\Where::_or([
|
||
|
|
\Where::_operator( \Account::$ID,'LIKE','%'.$q.'%' ),
|
||
|
|
\Where::_operator( \Account::$NAME,'LIKE','%'.$q.'%' ),
|
||
|
|
\Where::_operator( \Account::$EMAIL,'LIKE','%'.$q.'%' ),
|
||
|
|
]))
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
}
|