From ff624736490c0f73c46847276d6dcd5b88b1783d Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Mon, 1 Jul 2024 16:10:31 +0800 Subject: [PATCH] YS --- application/models/Squirrel.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index 7713f0f..f98ce87 100644 --- a/application/models/Squirrel.php +++ b/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;