From 588c0639ae249b12efbae539fd65dd5ca5792359 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Fri, 17 May 2024 13:38:39 +0800 Subject: [PATCH] =?UTF-8?q?YS:=E7=88=B6=E4=BA=B2=E6=AF=8D=E4=BA=B2?= =?UTF-8?q?=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 | 5 +++++ application/models/NewSquirrel.php | 3 +++ application/models/Squirrel.php | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/application/controllers/Api/Squirrel.php b/application/controllers/Api/Squirrel.php index 9ec1025..3e48221 100644 --- a/application/controllers/Api/Squirrel.php +++ b/application/controllers/Api/Squirrel.php @@ -247,5 +247,10 @@ class Api_SquirrelController extends Ctrl_Api{ if(!$ret) Tool_Fnc::apiMsg('添加失败', '500'); 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/NewSquirrel.php b/application/models/NewSquirrel.php index 460dc95..7f4201f 100644 --- a/application/models/NewSquirrel.php +++ b/application/models/NewSquirrel.php @@ -35,5 +35,8 @@ class NewSquirrelModel extends Orm_Base{ } return $data; } + public function getFatherAction(){ + + } } diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index b110923..19dcf51 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -76,5 +76,10 @@ class SquirrelModel extends Orm_Base{ public function getOneInfo($cage){ return $this->field('*')->where("id={$cage}")->fRow(); } + 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(); + return $data; + } }