YS:负责人接口

master
yangsai@163.com 8 months ago
parent eb328a4ff1
commit f406fe7bfd
  1. 10
      application/controllers/Api/Cage.php
  2. 4
      application/models/User.php

@ -9,10 +9,12 @@ class Api_CageController extends Ctrl_Api{
public $Cagemodel;
public $POST;
public $Cagecolormodel;
public $Usermodel;
public function init() {
$this->Cagemodel = new CageModel();
$this->POST =json_decode(file_get_contents('php://input'),true);
$this->Cagecolormodel = new CagecolorModel();
$this->Usermodel = new UserModel();
}
/**
* 鼠笼列表接口
@ -110,5 +112,13 @@ class Api_CageController extends Ctrl_Api{
$data = $this->Cagecolormodel->getModelList($params);
Tool_Fnc::apiMsg('获取成功', '200',$data);
}
/**
* 获取负责人接口
*/
public function getUserAction(){
$uid = empty($this->POST['uid'])?Tool_Fnc::apiMsg('请先登录', '500'):$this->POST['uid'];
$data = $this->Usermodel->getUser($uid);
Tool_Fnc::apiMsg('获取成功', '200',$data);
}
}

@ -16,8 +16,8 @@ class UserModel extends Orm_Base{
'is_delete' => array('type' => "int(11)",'comment' => '是否删除'),
);
public $pk = 'id';
public function getModelList(){
public function getUser($uid){
return $this->field('id,realname')->where("id!='{getUser}' and is_delete=0 and status=1")->fList();
}
}

Loading…
Cancel
Save