Bladeren bron

no message

wzh 5 jaren geleden
bovenliggende
commit
1adb6d04d6
1 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. 7 4
      api/application/controllers/Project.php

+ 7 - 4
api/application/controllers/Project.php

@@ -416,22 +416,25 @@ class Project extends Base_Controller {
             if ($role != SYSTEM_ADMIN) {
                 if ($role == 2) {
                     // $filter .= ' AND L.manu = '.$company;
-                    $where['L.manu = '] = $company;
+                    $where['P.company = '] = $company;
                     $sectionWhere['L.manu'] = $company;
                     // $countWhere[] = 'manu = '.$company;
                 }elseif ($role == 3) {
                     // $filter .= ' AND L.supplier = '.$company;
                     // $countWhere[] = 'supplier = '.$company;
-                    $where['L.supplier = '] = $company;
+                    // $where[''] = $company;
+                    $where = '(L.supplier = '.$company.' or P.company = '.$company.')';
                     $sectionWhere['L.supplier'] = $company;
                 }elseif ($role == 4) {
                     // $filter .= ' AND L.po = '.$company;
                     // $countWhere[] = 'po = '.$company;
-                    $where['L.po = '] = $company;
+                    // $where['L.po = '] = $company;
+                    $where = '(L.po = '.$company.' or P.company = '.$company.')';
                     $sectionWhere['L.po'] = $company;
                 }else {
                     // $filter .= ' AND P.cityid = '.$company;
-                    $where['P.cityid = '] = $company;
+                    // $where['P.cityid = '] = $company;
+                    $where = '(P.cityid = '.$company.' or P.company = '.$company.')';
                     $sectionWhere['P.cityid'] = $company;
                 }
             }