|
楼主 |
发表于 2015-1-20 16:13:41
|
显示全部楼层
public function devices_list1() {
$userName = $this->input->get('mac_address');
if(empty($mac_address)) {
exit(json_encode(array('code'=>404,'msg'=>'非法请求','data'=>array())));
}
//$select = "id, serial_number, device_sn, mac_address, room_name, default_power,fix_id,lessee_start_time,lessee_end_time,create_time";
$result = $this->device_model->get_device_list();
//var_dump($result);die;
if($result) {
exit(json_encode(array('code'=>200,'msg'=>'list ok','sysTime'=>date('Y-m-d H:i:s'),'data'=>$result)));
} else {
exit(json_encode(array('code'=>405,'msg'=>'记录为空','data'=>array())));
}
}
我现在想传入C8:93:46:46:4A:7B,获取单条数据,
http://192.168.1.108/rentairman/api/devices/devices_list1.json?mac_address=C8:93:46:46:4A:7B
但是输入并回车后就变成这个了4C%20AA%2016%2025%209D%202D
http://192.168.1.108/rentairman/api/devices/devices_list1.json?mac_address=4C%20AA%2016%2025%209D%202D
|
|