yangsai@163.com 5 months ago
parent 4044c9e443
commit ff62473649
  1. 5
      application/models/Squirrel.php

@ -94,10 +94,9 @@ class SquirrelModel extends Orm_Base{
$cageinfo = $CageModel->field("type")->where("id={$cage}")->fRow();
if($cageinfo['type']==2) {
$data = [];
$n = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=1 and cage={$cage}")->fRow();
$n = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=1 and cage={$cage}")->fList();
$m = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=2 and cage={$cage}")->fList();
$data[]=empty($n)?['id'=>0,'number'=>"未知",'sex'=>1]:$n;
$data[]=empty($m)?['id'=>0,'number'=>"未知",'sex'=>2]:$m;
$data=array_merge(empty($n)?['id'=>0,'number'=>"未知",'sex'=>1]:$n,empty($m)?['id'=>0,'number'=>"未知",'sex'=>2]:$m);
}
}
return $data;

Loading…
Cancel
Save