yangsai@163.com 6 months ago
parent a4e3beafb9
commit 6a53f3ecbf
  1. 10
      application/controllers/Api/Squirrel.php
  2. 4
      application/models/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'];
}
}

@ -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;

Loading…
Cancel
Save