Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AtiqurCode opened this issue Dec 2, 2024 · 0 comments

Comments

@AtiqurCode
Copy link

AtiqurCode commented Dec 2, 2024

        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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant