From 2db25c42e60db2649016c41cc54950bbe23efacb Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Tue, 11 Jun 2024 16:11:15 +0800 Subject: [PATCH] YS --- application/models/Cage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Cage.php b/application/models/Cage.php index ee1e259..6089376 100644 --- a/application/models/Cage.php +++ b/application/models/Cage.php @@ -37,19 +37,19 @@ class CageModel extends Orm_Base{ //查询鼠编号 $val['squirrel'] = $this->query("select number from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and type=1 limit 0,6"); //查询公鼠 - $sql = "select count(*) num from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and sex=1"; + $sql = "select count(*) num from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and sex=1 and type=1"; $mannum = $this->query($sql); if(!empty($mannum)){ $val['mannum'] = $mannum[0]['num']; } //查询母鼠 - $sql = "select count(*) num from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and sex=2"; + $sql = "select count(*) num from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and sex=2 and type=1"; $womannum = $this->query($sql); if(!empty($womannum)){ $val['womannum'] = $womannum[0]['num']; } //查询其他 - $sql = "select count(*) num from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and sex=0"; + $sql = "select count(*) num from squirrel where cage={$val['id']} and is_kill=0 and is_delete=0 and sex=0 and type=1"; $othernum = $this->query($sql); if(!empty($othernum)){ $val['othernum'] = $othernum[0]['num'];