feat: 修正庫存與撥補單邏輯並整合文件
1. 修復倉庫統計數據加總與樣式。 2. 修正可用庫存計算邏輯(排除不可銷售倉庫)。 3. 撥補單商品列表加入批號與效期顯示。 4. 修正撥補單儲存邏輯以支援精確批號轉移。 5. 整合 FEATURES.md 至 README.md。
This commit is contained in:
42
app/Modules/Core/Services/CoreService.php
Normal file
42
app/Modules/Core/Services/CoreService.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Core\Services;
|
||||
|
||||
use App\Modules\Core\Contracts\CoreServiceInterface;
|
||||
use App\Modules\Core\Models\User;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class CoreService implements CoreServiceInterface
|
||||
{
|
||||
/**
|
||||
* Get multiple users by their IDs.
|
||||
*
|
||||
* @param array $ids
|
||||
* @return Collection
|
||||
*/
|
||||
public function getUsersByIds(array $ids): Collection
|
||||
{
|
||||
return User::whereIn('id', $ids)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a specific user by ID.
|
||||
*
|
||||
* @param int $id
|
||||
* @return object|null
|
||||
*/
|
||||
public function getUser(int $id): ?object
|
||||
{
|
||||
return User::find($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all users.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAllUsers(): Collection
|
||||
{
|
||||
return User::all();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user