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

How to use wthCount, withSum and so on #63

Open
smilelanss opened this issue Feb 9, 2022 · 2 comments
Open

How to use wthCount, withSum and so on #63

smilelanss opened this issue Feb 9, 2022 · 2 comments

Comments

@smilelanss
Copy link

smilelanss commented Feb 9, 2022

Hi @sunel
$organizations = OrganizationEav::withCount('comments' )->get();
withCount don't work.
Is there a solution to this problem?

error
SQLSTATE[08P01]: <<Unknown error>>: 7 ERROR: bind message supplies 11 parameters, but prepared statement "pdo_stmt_00000013" requires 13 (SQL: select (select count(*) from "comments" where "organizations"."id" = "comments"."commentable_id" and "comments"."commentable_type" = organization and "status" = PUBLISHED and "parent_id" is null) as "comments_count"

@sunel
Copy link
Owner

sunel commented Feb 10, 2022

@smilelanss

Can you post the class blueprint here

@smilelanss
Copy link
Author

smilelanss commented Feb 14, 2022

@sunel
Class:
use App\EavModels\Organization as OrganizationEav;

Model:

use Eav\Model;
class Organization extends Model

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

2 participants