|
|
@@ -51,12 +51,16 @@ class CfRoomPlan extends Backend |
|
|
|
public function getList(){ |
|
|
|
$name=$this->request->post('name'); |
|
|
|
$keyValue=$this->request->post('keyValue'); |
|
|
|
$this->model->field('id,plan_name as name,purchase_user_id'); |
|
|
|
$this->model->field('id,plan_name as name,purchase_user_id,plan_memo'); |
|
|
|
if($keyValue){ |
|
|
|
$this->model->where(['id'=>$keyValue]); |
|
|
|
}elseif($name){ |
|
|
|
$this->model->where(['plan_name'=>['like','%'.$name.'%']]); |
|
|
|
} |
|
|
|
$roomId =$this->request->get('room_id'); |
|
|
|
if ($roomId){ |
|
|
|
$this->model->where("room_id","=",$roomId); |
|
|
|
} |
|
|
|
$result= $this->model->select(); |
|
|
|
if($keyValue){ |
|
|
|
return json(['list' => $result]); |
|
|
|