diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index f98ce87..237a9cc 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -94,7 +94,7 @@ 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}")->fList(); + $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(); $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=array_merge(empty($n)?['id'=>0,'number'=>"未知",'sex'=>1]:$n,empty($m)?['id'=>0,'number'=>"未知",'sex'=>2]:$m); }