root 2 жил өмнө
parent
commit
d71566937a

+ 3 - 3
app/Model/BoxDetail.php

@@ -37,10 +37,10 @@ class BoxDetail extends Model
     public function __construct(array $attributes = [])
     {
         parent::__construct($attributes);
-        if (isset($attributes['channel']) && $attributes['channel']) {
+        if (isset($attributes['channel']) && $attributes['channel'] > 0) {
             $channel = $attributes['channel'];
-            $month = (int)substr($channel,6,2);
-            $channel = substr($channel,2,4).$this->month[$month];
+            $month = (int)substr($channel,4,2);
+            $channel = substr($channel,0,4).$this->month[$month];
             $this->setTableById($channel);
         }
     }