master
yangsai@163.com 9 months ago
parent 76148eb644
commit d698006e44
  1. 1
      application/controllers/Api/Squirrel.php
  2. 2
      application/models/Squirrel.php

@ -248,7 +248,6 @@ class Api_SquirrelController extends Ctrl_Api{
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);
}

@ -78,7 +78,7 @@ class SquirrelModel extends Orm_Base{
}
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();
$data=$this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}'")->fList();
return $data;
}
}

Loading…
Cancel
Save