From 0eea0df19ac374467a11d2cd9b64a1fc883c757e Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Mon, 20 May 2024 17:32:29 +0800 Subject: [PATCH] YS --- application/controllers/Api/Cage.php | 2 +- application/models/Cage.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/controllers/Api/Cage.php b/application/controllers/Api/Cage.php index e83e739..11dae7e 100644 --- a/application/controllers/Api/Cage.php +++ b/application/controllers/Api/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); } diff --git a/application/models/Cage.php b/application/models/Cage.php index 0d6f3a6..9f2f324 100644 --- a/application/models/Cage.php +++ b/application/models/Cage.php @@ -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; } }