nizongfeng 3 lat temu
rodzic
commit
77f45cceac
3 zmienionych plików z 13 dodań i 10 usunięć
  1. +4
    -3
      application/admin/controller/CfItem.php
  2. +5
    -4
      application/admin/controller/CfRoomPlan.php
  3. +4
    -3
      application/admin/model/CfHotelInfo.php

+ 4
- 3
application/admin/controller/CfItem.php Wyświetl plik

@@ -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);


+ 5
- 4
application/admin/controller/CfRoomPlan.php Wyświetl plik

@@ -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]);
}


+ 4
- 3
application/admin/model/CfHotelInfo.php Wyświetl plik

@@ -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();
}




Ładowanie…
Anuluj
Zapisz