From 4105470cd94af4699efc5f59d7b43770cbff1224 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Fri, 17 May 2024 11:45:03 +0800 Subject: [PATCH] YS --- application/models/Cage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/models/Cage.php b/application/models/Cage.php index 0d45a16..64e76c3 100644 --- a/application/models/Cage.php +++ b/application/models/Cage.php @@ -20,14 +20,14 @@ 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"; + $sql = "select id,number,color,strains,type from cage "; if(!empty($params['keyword'])){ - $sql .=" where cage.number like '%{$params['keyword']}%'"; + $sql .=" where number like '%{$params['keyword']}%'"; } if(!empty($params['order'])){ - $sql .=" order by cage.{$params['order']} desc"; + $sql .=" order by {$params['order']} desc"; }else{ - $sql .=" order by cage.id desc"; + $sql .=" order by id desc"; } $data['count'] = count($this->query($sql)); $offset = ($params['page']-1)*$limmit;