yangsai@163.com 8 months ago
parent 79d92a2e55
commit 12b2c7e405
  1. 16
      application/models/Squirrel.php
  2. 2
      application/models/User.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;
}

@ -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();
}
}

Loading…
Cancel
Save