單位顯示修正

This commit is contained in:
2026-01-08 12:00:36 +08:00
parent 48115082e5
commit 7848976a06
3 changed files with 12 additions and 9 deletions

View File

@@ -39,7 +39,7 @@ class ProductController extends Controller
$sortDirection = $request->input('sort_direction', 'desc');
// Define allowed sort fields to prevent SQL injection
$allowedSorts = ['id', 'code', 'name', 'category_id', 'base_unit', 'conversion_rate'];
$allowedSorts = ['id', 'code', 'name', 'category_id', 'base_unit_id', 'conversion_rate'];
if (!in_array($sortField, $allowedSorts)) {
$sortField = 'id';
}
@@ -62,7 +62,6 @@ class ProductController extends Controller
$categories = \App\Models\Category::where('is_active', true)->get();
return Inertia::render('Product/Index', [
'products' => $products,
'products' => $products,
'categories' => $categories,
'units' => Unit::all(),