From 12b2c7e405a0637f06d7b680ae0efd0171565b12 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Thu, 6 Jun 2024 15:05:46 +0800 Subject: [PATCH] YS --- application/models/Squirrel.php | 16 +++++++++++++++- application/models/User.php | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index da1530f..ab1941a 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -76,7 +76,7 @@ class SquirrelModel extends Orm_Base{ return $data; } public function getOneInfo($squirrel){ - return $this->field('id,number,sex,birthday,father,mother,strains_id as strains,gene,hair_color,cage,remark')->where("id={$squirrel}")->fRow(); + return $this->field('id,number,sex,birthday,father,mother,strains_id as strains,gene,hair_color,cage,remark,c_user_id')->where("id={$squirrel}")->fRow(); } public function partent($cage){ $time = date('Y-m-d',time()); @@ -107,11 +107,25 @@ class SquirrelModel extends Orm_Base{ return $data; } public function operate($params){ + $remind = array('test_time'=>"已到可实验时间","jianwei_time"=>"已到可剪尾时间","kill_time"=>"已到可处死时间","del_time"=>"已到可删除时间"); + //获取小鼠信息 + $info = $this->getOneInfo($params['id']); + $remindarray = []; foreach($params as $key => $val){ if(empty($val)){ unset($params[$key]); + }else{ + if(isset($remind[$key])){ + $item['content'] = $info['number'].$remind[$key]; + $item['user_id'] = $info['c_user_id']; + $item['created'] = $val." ".date("H:i:s"); + $remindarray[] = $item; + } } } + $remindModel = new RemindModel(); + $remindModel->inserts($remindarray); + //更新待办 if(!$this->update($params)) return false; return true; } diff --git a/application/models/User.php b/application/models/User.php index 896ec97..4797abd 100644 --- a/application/models/User.php +++ b/application/models/User.php @@ -17,7 +17,7 @@ class UserModel extends Orm_Base{ ); public $pk = 'id'; public function getUser($uid){ - return $this->field('id,realname')->where("id!='{getUser}' and is_delete=0 and status=1")->fList(); + return $this->field('id,realname')->where("id='{$uid}' and is_delete=0 and status=1")->fList(); } }