Skip to content

Want to achieve with customer orders count and select specific columns for customers table #87

Open
@AtiqurCode

Description

@AtiqurCode
        Search::add(Customer::withCount('orders')->select('id', 'first_name', 'last_name', 'email', 'orders_count'), ['first_name', 'last_name'], 'first_name')
            ->add(Order::orderListSelectColumns(), ['order_number'], 'order_date')
            ->endWithWildcard()
            ->includeModelType()
            ->orderByDesc()
            ->paginate(25)
            ->search($searchValue);

Want to achieve with customer order count and select specific columns for customers' table?

But the count not coming orders_count not found error returning

Column not found: 1054 Unknown column 'orders_count' in 'field list'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions