浏览代码

no message

MS-PDRLKVHCADMG\Administrator 5 年之前
父节点
当前提交
77251197f1
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 14 6
      api/application/controllers/Lampcontrol.php

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

@@ -1784,15 +1784,23 @@ class Lampcontrol extends Base_Controller {
                         $res = 1;
                         $msg[] = 'Table '.$num.' row.Wireless module address already exists';
                     }
-                    if ($role != SYSTEM_ADMIN) {
-                        if ($role == 2) {
-                            $value["manu"] = $company;
-                        }elseif ($role == 4) {
-                            $value["po"] = $company;
+                    $data["manu"] = $this->get_manu_by_address($data["address"]);
+
+                    if (empty($data["manu"])) {
+                        $res = 1;
+                        $msg[] = 'Table '.$num.' row.Invalid ID';
+                    }else{
+                        if ($role != SYSTEM_ADMIN) {
+                            if ($role == 2) {
+                                if ($value["manu"] != $company) {
+                                    $res = 1;
+                                    $msg[] = 'Table '.$num.' row.Invalid ID';
+                                }
+                            }
                         }
                     }
+                    
 
-                    if (!isset($value["manu"])) $value["manu"] = $this->get_manu_by_address($value["address"]);
                 }
             }
             $value['section'] = trim($value['section']);