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