瀏覽代碼

no message

MS-PDRLKVHCADMG\Administrator 5 年之前
父節點
當前提交
039b21338e
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 2 0
      api/application/config/response.php
  2. 6 2
      api/application/controllers/Lampcontrol.php

+ 2 - 0
api/application/config/response.php

@@ -80,6 +80,7 @@ $config['response']['0419'] = '设备未绑定路段信息';
 $config['response']['0420'] = '只有杀虫灯设备能设置策略';
 $config['response']['0421'] = '经度范围错误';
 $config['response']['0422'] = '纬度范围错误';
+$config['response']['0423'] = "无效的ID";
 //报表 0500-0599
 $config['response']['0500'] = "type不正确";
 $config['response']['0501'] = "show_type不正确";
@@ -248,6 +249,7 @@ $config['response_en']['0419'] = 'Section information not bound by equipment';
 $config['response_en']['0420'] = 'Only the insecticidal lamp device can set the strategy';
 $config['response_en']['0421'] = 'Longitude range error';
 $config['response_en']['0422'] = 'Latitude range error';
+$config['response_en']['0423'] = "Invalid ID";
 //报表 0500-0599
 $config['response_en']['0500'] = "Incorrect type";
 $config['response_en']['0501'] = "show_type Incorrect";

+ 6 - 2
api/application/controllers/Lampcontrol.php

@@ -897,11 +897,15 @@ class Lampcontrol extends Base_Controller {
             $data["loadtype"] = intval($loadtype);
         }
 
+        $data["manu"] = $this->get_manu_by_address($data["address"]);
+
         $role = $this->get_user_info('role');
         $company = $this->get_user_info('company');
         if ($role != SYSTEM_ADMIN) {
             if ($role == 2) {
-                $data["manu"] = $company;
+                if ($data["manu"] != $company) {
+                    exit(json_result('0423',$this->response['0423']));
+                }
             }elseif ($role == 4) {
                 $data["po"] = $company;
             }else{
@@ -909,7 +913,7 @@ class Lampcontrol extends Base_Controller {
             }
         }
 
-        if (!isset($data["manu"])) $data["manu"] = $this->get_manu_by_address($data["address"]);
+        // if (!isset($data["manu"])) $data["manu"] = $this->get_manu_by_address($data["address"]);
         
         // 控制器协议类型
         $version = $this->session->userdata('version');