From d698006e446578f31b867247e9990871e515d4e5 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Fri, 17 May 2024 14:03:51 +0800 Subject: [PATCH] =?UTF-8?q?YS:=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/Api/Squirrel.php | 1 - application/models/Squirrel.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/application/controllers/Api/Squirrel.php b/application/controllers/Api/Squirrel.php index eecbbc4..1b243b8 100644 --- a/application/controllers/Api/Squirrel.php +++ b/application/controllers/Api/Squirrel.php @@ -248,7 +248,6 @@ class Api_SquirrelController extends Ctrl_Api{ Tool_Fnc::apiMsg('添加成功', '200'); } public function getparentsAction(){ - $data['sex'] = empty($this->POST['sex'])||!isset($this->POST['sex'])?Tool_Fnc::apiMsg('缺少性别参数', '500'):Tool_Fnc::safe_string($this->POST['sex']); $return = $this->Squirrelmodel->partent($data); Tool_Fnc::apiMsg('获取成功', '200',$return); } diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index 19dcf51..e86638b 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -78,7 +78,7 @@ class SquirrelModel extends Orm_Base{ } public function partent($params){ $time = date('Y-m-d',time()); - $data=$this->field('id,number')->where("is_delete=0 and is_kill=0 and sex = {$params['sex']} and grow_time<'{$time}'")->fList(); + $data=$this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}'")->fList(); return $data; } }