|
@@ -283,14 +283,20 @@ class Common extends CI_Controller {
|
|
|
// 通过设备地址获取制造商id
|
|
|
public function get_manu_by_address(){
|
|
|
$address = $this->input->post('address',true);
|
|
|
+ $name = '';
|
|
|
if ($address === '' || $address === null){
|
|
|
$id = 0;
|
|
|
}else{
|
|
|
- $res = $this->db->query('select id from company where companyId like "'.$id.'%" order by id desc')->row_array();
|
|
|
+ $res = $this->db->query('select id,name,no from company where companyId like "'.$id.'%" order by id desc')->row_array();
|
|
|
if (empty($res) || empty($res['id'])) {
|
|
|
$id = 0;
|
|
|
}else{
|
|
|
$id = $res['id'];
|
|
|
+ if (!empty($res['no'])) {
|
|
|
+ $name = $res['no'];
|
|
|
+ }else{
|
|
|
+ $name = $res['name'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
exit(json_result('0000',$this->response['0000'],array('id'=>$id)));
|