update expense item name
This commit is contained in:
@@ -68,8 +68,17 @@ func (r *ExpenseRepositoryImpl) List(ctx context.Context, organizationID uuid.UU
|
||||
case "search":
|
||||
if searchStr, ok := value.(string); ok && searchStr != "" {
|
||||
searchPattern := "%" + strings.ToLower(searchStr) + "%"
|
||||
query = query.Where("LOWER(expense_name) LIKE ? OR LOWER(receiver) LIKE ? OR LOWER(code_number) LIKE ? OR LOWER(description) LIKE ?",
|
||||
searchPattern, searchPattern, searchPattern, searchPattern)
|
||||
query = query.Where(`
|
||||
LOWER(receiver) LIKE ?
|
||||
OR LOWER(code_number) LIKE ?
|
||||
OR LOWER(description) LIKE ?
|
||||
OR EXISTS (
|
||||
SELECT 1
|
||||
FROM expense_items ei
|
||||
WHERE ei.expense_id = expenses.id
|
||||
AND LOWER(ei.item) LIKE ?
|
||||
)
|
||||
`, searchPattern, searchPattern, searchPattern, searchPattern)
|
||||
}
|
||||
case "outlet_id":
|
||||
if outletID, ok := value.(uuid.UUID); ok {
|
||||
|
||||
Reference in New Issue
Block a user