From 8bc7259f050d50d63aa4ef2aaa31caae8fc65d76 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Thu, 16 May 2024 15:58:28 +0800 Subject: [PATCH] =?UTF-8?q?YS:=E7=AC=BC=E4=BD=8D=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/Cage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Cage.php b/application/models/Cage.php index a2fd508..6ebff3b 100644 --- a/application/models/Cage.php +++ b/application/models/Cage.php @@ -20,9 +20,9 @@ class CageModel extends Orm_Base{ $cagemodel = new CageSetModel(); $shownum = $cagemodel->field('line_num')->where("c_user_id='{$params['uid']}'")->fRow(); $limmit = empty($shownum['line_num'])?20:$shownum['line_num']*5; - $sql = "select cage.id,cage.number,cage.color,strains.title strains,cage.type from cage left join strains on cage.strains=strains.id where 1 and "; + $sql = "select cage.id,cage.number,cage.color,strains.title strains,cage.type from cage left join strains on cage.strains=strains.id"; if(!empty($params['keywords'])){ - $sql .="cage.number like '%{$params['keywords']}%'"; + $sql .=" where cage.number like '%{$params['keywords']}%'"; } if(!empty($params['order'])){ $sql .=" order by cage.{$params['order']} desc";