From 6a53f3ecbf5afd0f3d1016d286ffa9495a33da58 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Fri, 17 May 2024 15:48:53 +0800 Subject: [PATCH] YS --- application/controllers/Api/Squirrel.php | 10 +++++++++- application/models/Squirrel.php | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/application/controllers/Api/Squirrel.php b/application/controllers/Api/Squirrel.php index 2bf96b9..fc47190 100644 --- a/application/controllers/Api/Squirrel.php +++ b/application/controllers/Api/Squirrel.php @@ -100,7 +100,7 @@ class Api_SquirrelController extends Ctrl_Api{ $data['strains_id'] =empty($this->POST['strains_id'])||!isset($this->POST['strains_id'])?Tool_Fnc::apiMsg('请选择品系', '500'):Tool_Fnc::safe_string($this->POST['strains_id']); $data['gene'] =empty($this->POST['gene'])||!isset($this->POST['gene'])?Tool_Fnc::apiMsg('请填写基因', '500'):Tool_Fnc::safe_string($this->POST['gene']); $data['hair_color'] =empty($this->POST['hair_color'])||!isset($this->POST['hair_color'])?Tool_Fnc::apiMsg('请选择毛色', '500'):Tool_Fnc::safe_string($this->POST['hair_color']); - $data['remark'] = empty($this->POST['remark'])||!isset($this->POST['remark'])?Tool_Fnc::apiMsg('请填写备注', '500'):Tool_Fnc::safe_string($this->POST['remark']); + $data['remark'] = empty($this->POST['remark'])||!isset($this->POST['remark'])?'':Tool_Fnc::safe_string($this->POST['remark']); $data['cage'] =empty($this->POST['cage'])||!isset($this->POST['cage'])?Tool_Fnc::apiMsg('未找到当前笼位ID', '500'):Tool_Fnc::safe_string($this->POST['cage']); $data['created'] = date('Y-m-d H:i:s',time()); //判断鼠笼鼠的数量是否可以容纳 @@ -259,5 +259,13 @@ class Api_SquirrelController extends Ctrl_Api{ $data = $this->Squirrelmodel->getIcon($id); Tool_Fnc::apiMsg('获取成功', '200',$data); } + public function operateAction(){ + $data['jianwei_time'] = $this->POST['jianwei_time']; + $data['test_time'] = $this->POST['test_time']; + $data['kill_time'] = $this->POST['kill_time']; + $data['del_time'] = $this->POST['del_time']; + + + } } diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index a19daa4..54e8c94 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -79,8 +79,8 @@ class SquirrelModel extends Orm_Base{ } public function getIcon($squirrel){ $date = strtotime(date('Y-m-d',time())); - $info = $this->field('nusring_time')->where("id={$squirrel}")->fRow(); - if(strtotime($info['nusring_time'])>$date){ + $info = $this->field('nursing_time')->where("id={$squirrel}")->fRow(); + if(strtotime($info['nursing_time'])>$date){ $data['icon'] = $_SERVER['HTTP_HOST'].Yaf_Registry::get("config")->cangshu->url->small; }else{ $data['icon'] =$_SERVER['HTTP_HOST'].Yaf_Registry::get("config")->cangshu->url->big;