cqpCow há 1 ano atrás
pai
commit
4607d50a99
2 ficheiros alterados com 2 adições e 9 exclusões
  1. 1 9
      app/Model/ProductActivity.php
  2. 1 0
      app/Service/BookingListService.php

+ 1 - 9
app/Model/ProductActivity.php

@@ -16,7 +16,6 @@ class ProductActivity extends Model
 
     public static $user = [];
     public static $search = [];
-    public static $is_search = false;
     const range_function = '';
 
     public function __construct(array $attributes = [])
@@ -25,15 +24,8 @@ class ProductActivity extends Model
             self::$user = $attributes['userData'];
             self::$user['range_function'] = self::range_function;
             self::$search = $attributes['search'] ?? [];
-            self::$is_search = true;
-        }
-        parent::__construct($attributes);
-    }
-
-    protected static function boot(){
-        parent::boot();
-        if(self::$is_search){
             static::addGlobalScope(new DepartmentScope(self::$user,self::$search));
         }
+        parent::__construct($attributes);
     }
 }

+ 1 - 0
app/Service/BookingListService.php

@@ -198,6 +198,7 @@ class BookingListService extends Service
             $data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s',$value['crt_time']) : '';
             $data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
             $data['data'][$key]['state_title'] = BookingList::$name[$value['state']] ?? '';
+            $data['data'][$key]['type_title'] = BookingList::$model_type[$value['type']] ?? '';
         }
 
         return $data;