From 77f45cceacf8736d78a38fcc6efcd5011757b79c Mon Sep 17 00:00:00 2001 From: nizongfeng Date: Tue, 23 Nov 2021 16:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/CfItem.php | 7 ++++--- application/admin/controller/CfRoomPlan.php | 9 +++++---- application/admin/model/CfHotelInfo.php | 7 ++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/application/admin/controller/CfItem.php b/application/admin/controller/CfItem.php index 44cf12d..fcb0753 100755 --- a/application/admin/controller/CfItem.php +++ b/application/admin/controller/CfItem.php @@ -213,12 +213,13 @@ class CfItem extends Backend $name=$this->request->post('name'); $keyValue=$this->request->post('keyValue'); $this->model->field('id,item_name as name,item_unit,item_type,item_memo'); + $where = ["del_flag"=>0]; if($keyValue){ - $this->model->where(['id'=>$keyValue,"del_flag"=>0]); + $where = ['id'=>$keyValue,"del_flag"=>0]; }elseif($name){ - $this->model->where(['item_name'=>['like','%'.$name.'%'],"del_flag"=>0]); + $where = ['item_name'=>['like','%'.$name.'%'],"del_flag"=>0]; } - $result= $this->model->select()->toArray(); + $result= $this->model->where($where)->select()->toArray(); $config = \think\Config::get("site.item_category"); $config = json_decode($config,true); diff --git a/application/admin/controller/CfRoomPlan.php b/application/admin/controller/CfRoomPlan.php index 890867e..0b38a57 100755 --- a/application/admin/controller/CfRoomPlan.php +++ b/application/admin/controller/CfRoomPlan.php @@ -52,16 +52,17 @@ class CfRoomPlan extends Backend $name=$this->request->post('name'); $keyValue=$this->request->post('keyValue'); $this->model->field('id,plan_name as name,purchase_user_id,plan_memo'); + $where = ["del_flag"=>0]; if($keyValue){ - $this->model->where(['id'=>$keyValue,"del_flag"=>0]); + $where = ['id'=>$keyValue,"del_flag"=>0]; }elseif($name){ - $this->model->where(['plan_name'=>['like','%'.$name.'%'],"del_flag"=>0]); + $where = ['plan_name'=>['like','%'.$name.'%'],"del_flag"=>0]; } $roomId =$this->request->get('room_id'); if ($roomId){ - $this->model->where("room_id","=",$roomId); + $where["room_id"] = $roomId; } - $result= $this->model->select(); + $result= $this->model->where($where)->select(); if($keyValue){ return json(['list' => $result]); } diff --git a/application/admin/model/CfHotelInfo.php b/application/admin/model/CfHotelInfo.php index 3e2acfa..60154d2 100755 --- a/application/admin/model/CfHotelInfo.php +++ b/application/admin/model/CfHotelInfo.php @@ -31,12 +31,13 @@ class CfHotelInfo extends Model public function getList($name='',$keyValue=''){ $this->field('id,hotel_name as name'); + $where = ["del_flag"=>0]; if($keyValue){ - $this->where(['id'=>$keyValue,"del_flag"=>0]); + $where = ['id'=>$keyValue,"del_flag"=>0]; }elseif($name){ - $this->where(['hotel_name'=>['like','%'.$name.'%'],"del_flag"=>0]); + $where = ['hotel_name'=>['like','%'.$name.'%'],"del_flag"=>0]; } - return $this->select()->toArray(); + return $this->where($where)->select()->toArray(); }