rabin il y a 3 ans
Parent
commit
8ce342afdf
1 fichiers modifiés avec 16 ajouts et 0 suppressions
  1. 16 0
      src/Company.php

+ 16 - 0
src/Company.php

@@ -58,6 +58,22 @@ class Company extends Save
             } else {
                 $company_id = false;
             }
+        } else {
+            $auth = $this->getAuth();
+            if ($auth) {
+                if (is_string($auth)) {
+                    $auth = explode(',', $auth);
+                }
+                if (!in_array($company_id, $auth)) {
+                    $company = $this->getData();
+                    if ($company) {
+                        $company_id = $company[0]['id'];
+                        $this->set($company_id);
+                    } else {
+                        $company_id = false;
+                    }
+                }
+            }
         }
         return $company_id;
     }