yuang 4 лет назад
Родитель
Сommit
25ac1e78d3

+ 4 - 4
app/Filters/OrderPackageFilters.php

@@ -57,12 +57,12 @@ class OrderPackageFilters
     public function apply($builder)
     {
         $this->queryBuilder = $builder;
-        $filters = array_filter($this->request->only($this->filters),function($item){
+        $filters = array_filter($this->request->only($this->filters), function ($item) {
             return $item !== null;
         });
         $this->queryBuilder
-            ->whereIn('status', [0,1,2,3,4,5,6,7,8,9,null])
-            ->whereIn('exception_status', [0,1,2,3,4,5,6,7,null]);
+            ->whereIn('status', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, null])
+            ->whereIn('exception_status', [0, 1, 2, 3, 4, 5, 6, 7, null]);
         foreach ($filters as $filter => $value) {
             if (method_exists($this, $filter)) {
                 $this->$filter($value, $this->queryBuilder);
@@ -104,7 +104,7 @@ class OrderPackageFilters
 
     private function status($status)
     {
-        $statuses = array_filter(preg_split('/[,, ]+/is', $status),function($item){
+        $statuses = array_filter(preg_split('/[,, ]+/is', $status), function ($item) {
             return $item !== null;
         });
         $this->queryBuilder->whereIn('status', $statuses);

+ 4 - 0
app/Http/Controllers/PackageLogisticController.php

@@ -68,7 +68,11 @@ class PackageLogisticController extends Controller
 
         /** @var UserService $userService */
         $userService = app('UserService');
+        /** @var array $owner_ids */
         $owner_ids = $userService->getPermittingOwnerIds(auth()->user());
+        $owner_ids = array_map(function ($item) {
+            return $item = (int)$item;
+        }, $owner_ids);
         $total = OrderPackage::query()
             ->selectRaw("count(*) as total")
             ->filter($filters)