xg il y a 2 ans
Parent
commit
c57c7934ac
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5 2
      application/common/service/SubService.php

+ 5 - 2
application/common/service/SubService.php

@@ -14,11 +14,14 @@ class SubService{
 
     public function __construct($chanId,$fromWhere)
     {
+        if(!$chanId){
+            return;
+        }
         $this->chanId=$chanId;
         if($fromWhere=='admin'){
-            $this->admin=Admin::get($chanId);
+            $this->admin=Admin::where('id',$chanId)->find();
         }elseif ($fromWhere=='api'){
-            $this->admin=Admin::sub()->find($chanId);
+            $this->admin=Admin::sub()->where('id',$chanId)->find();
         }
         $this->getRules();
     }