Zhouzhendong 4 лет назад
Родитель
Сommit
adb974ca1f
2 измененных файлов с 3 добавлено и 5 удалено
  1. 1 1
      app/Services/AllInventoryService.php
  2. 2 4
      app/Services/OwnerService.php

+ 1 - 1
app/Services/AllInventoryService.php

@@ -15,7 +15,7 @@ class AllInventoryService
 
     protected $modelClass=AllInventory::class;
     public function getSql(array $params, $page=null, $paginate=null){
-        $ownerCodes=app("OwnerService")->getCodeArr();
+        $ownerCodes = app("OwnerService")->getCodeArr();
         $date_start=$params['date_start'] ?? null;
         $range = $params['range'] ?? null;
         if ($range)$date_start=date('Y-m-d',strtotime('-'.$range." day"));

+ 2 - 4
app/Services/OwnerService.php

@@ -541,7 +541,7 @@ sql;
     /**
      * 获取税率 或 税费
      *
-     * @param Model|\stdClass $model
+     * @param Model $model
      * @param int $ownerId
      * @param float|null $money
      *
@@ -566,7 +566,7 @@ sql;
         return $money * ($taxRate->value / 100);
     }
 
-    public function changeManualBackStatus($id, $isManual)
+    public function changeManualBackStatus($id, $isManual): Model|Builder|array|null
     {
         $owner = Owner::query()->find($id);
         if ($isManual == 0) $owner->update(['is_manual_back' => 1]);
@@ -603,11 +603,9 @@ sql;
         if (!$userId) $userId = Auth::id();
         $query = Owner::query()->select("owners." . $column);
         if (!app("UserService")->checkAdminIdentity($userId) && !app("AuthorityService")->checkAllOwner($userId)) {
-            //$query->whereHas("roles",function ($query)use($userId){
             $query->whereHas("users", function ($query) use ($userId) {
                 $query->where("users.id", $userId);
             });
-            //});
         }
         return $query->whereNull("deleted_at");
     }