2 Commits 6eaf9ad02b ... ac2c5ffc1e

Autor SHA1 Mensagem Data
  wu ac2c5ffc1e Merge branch 'master' of http://git.dever.cc:3000/dever-package/manage into fengyong 8 meses atrás
  wu 125366c788 添加 setFactory方法 8 meses atrás
1 arquivos alterados com 16 adições e 0 exclusões
  1. 16 0
      src/Company.php

+ 16 - 0
src/Company.php

@@ -37,6 +37,22 @@ class Company extends Save
         return false;
     }
 
+    public function setFactory()
+    {
+        $factory_id = Dever::input('factory_id');
+        $auth = $this->getAuth();
+        if($auth){
+            if (is_string($auth)) {
+                $auth = explode(',', $auth);
+            }
+
+            if (in_array($factory_id, $auth)) {
+                return $this->_add('factory', $factory_id, 3600 * 24 * 365);
+            }
+        }
+        return false;
+    }
+
     # 获取公司权限
     public function get()
     {