DESKTOP-9JTA2JJ\HP 5 jaren geleden
bovenliggende
commit
cff9ce027a
2 gewijzigde bestanden met toevoegingen van 16 en 0 verwijderingen
  1. 4 0
      api/application/controllers/Company.php
  2. 12 0
      api/application/controllers/Lampcontrol.php

+ 4 - 0
api/application/controllers/Company.php

@@ -85,11 +85,15 @@ class Company extends Base_Controller {
 	// 公司下拉
 	public function nav(){
 		$where = array();
+		$company = $this->get_user_info('company');
+		$role = $this->get_user_info('role');
 
 		$type = intval($this->input->post('type',true));
 
 		if (!empty($type)) $where['type'] = $type;
 
+		if ($type == $role) $where['id'] = $company;
+
         $list = $this->Company_model->get_list($where, 'id,name',null, null, 'name asc,id desc', NUll);
 
         exit(json_result('0000',$this->response['0000'],array('list'=>$list)));

+ 12 - 0
api/application/controllers/Lampcontrol.php

@@ -1349,6 +1349,18 @@ class Lampcontrol extends Base_Controller {
             $data["loadtype"] = intval($loadtype);
         }
 
+        $role = $this->get_user_info('role');
+        $company = $this->get_user_info('company');
+        if ($role != SYSTEM_ADMIN) {
+            if ($role == 3) {
+                $data["supplier"] = $company;
+            }elseif ($role == 4) {
+                $data["po"] = $company;
+            }else{
+                exit(json_result('0013',$this->response['0013']));
+            }
+        }
+        
         // 控制器协议类型
         $version = $this->session->userdata('version');