wzh 5 år sedan
förälder
incheckning
969c55eb1d
1 ändrade filer med 16 tillägg och 0 borttagningar
  1. 16 0
      api/application/controllers/User.php

+ 16 - 0
api/application/controllers/User.php

@@ -420,5 +420,21 @@ class User extends Base_Controller{
             exit(json_result('0000',$this->response['0000']));
         }
     }
+
+    public function company_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 ($role != SYSTEM_ADMIN) $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)));
+    }
 }
 ?>