42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\model\information\UserInformationg;
|
|
use app\common\logic\BaseLogic;
|
|
|
|
class InformationController extends BaseApiController
|
|
{
|
|
public function list()
|
|
{
|
|
$param = Request()->param();
|
|
[$page, $limit] = $this->getPage();
|
|
$data['create_user_id'] = $this->userId;
|
|
$res = UserInformationg::list($data,$page,$limit);
|
|
if ($res != true) {
|
|
return $this->fail( BaseLogic::getError());
|
|
}
|
|
return $this->success('ok', $res->toArray());
|
|
}
|
|
|
|
public function add()
|
|
{
|
|
$param = Request()->param();
|
|
$param['admin_id'] = $this->userId;
|
|
$res = UserInformationg::add($param);
|
|
if ($res != true) {
|
|
return $this->fail( BaseLogic::getError());
|
|
}
|
|
return $this->success('成功');
|
|
}
|
|
|
|
public function details(){
|
|
$param = Request()->param();
|
|
$res = UserInformationg::details($param['id']);
|
|
if ($res != true) {
|
|
return $this->fail( BaseLogic::getError());
|
|
}
|
|
return $this->success('成功',$res->toArray());
|
|
}
|
|
}
|