where($where) ->limit($limit) ->get() ->toArray(); } function addRecord($data){ $res=$this->insert($data); if(!$res){ return -6030001222; } } function getIdData($id){ return $this->where("id",$id)->first(); } public function updateIdData(int $id,$data){ return $this->where("id",$id)->update($data); } //获取所有房间 2019-01-19 anton liu function getAll() { $data = $this->select('id','room_name')->orderBy('id','asc')->get()->toArray(); if(!$data){ return -5040000522;//没有数据 } return $data; } }