[FEAT] 實作跨倉庫及時庫存批號搜尋與 Debounce 搜尋體驗
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 56s

This commit is contained in:
2026-03-05 11:51:13 +08:00
parent 7c395c89b5
commit f4ed358393
5 changed files with 119 additions and 29 deletions

View File

@@ -303,12 +303,14 @@ class InventoryService implements InventoryServiceInterface
$query->where('products.category_id', $filters['category_id']);
}
// 篩選:關鍵字(商品代碼或名稱)
// 篩選:關鍵字(商品代碼或名稱或批號
if (!empty($filters['search'])) {
$search = $filters['search'];
$query->where(function ($q) use ($search) {
$q->where('products.code', 'like', "%{$search}%")
->orWhere('products.name', 'like', "%{$search}%");
->orWhere('products.name', 'like', "%{$search}%")
->orWhere('inventories.batch_number', 'like', "%{$search}%")
->orWhere(\Illuminate\Support\Facades\DB::raw("CONCAT('BATCH-', inventories.id)"), 'like', "%{$search}%");
});
}