yangsai@163.com 8 months ago
parent 980e2fc580
commit 0eea0df19a
  1. 2
      application/controllers/Api/Cage.php
  2. 3
      application/models/Cage.php

@ -123,7 +123,7 @@ class Api_CageController extends Ctrl_Api{
$id = empty($this->POST['id'])?Tool_Fnc::apiMsg('缺少笼位ID', '500'):$this->POST['id'];
$params['where'] = "and cage = {$id}";
$data['cage'] = $this->Cagemodel->getOneInfo($id);
$data['cage']['code'] = '';
$data['cage']['code'] = Yaf_Registry::get("config")->web->url->img;
$data['squirrel'] = $this->SquirrelModel->getModelList($params);
Tool_Fnc::apiMsg('获取成功', '200',$data);
}

@ -52,7 +52,10 @@ class CageModel extends Orm_Base{
return $data;
}
public function getOneInfo($id){
$UserModel = new UserModel();
$info = $this->field('*')->where("id='{$id}'")->fRow();
//负责人id
$info['user'] = $UserModel->field('realname')->fRow()['realname'];
return $info;
}
}

Loading…
Cancel
Save