etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 459 forks source link

join with another table, throw an exception #285

Open xiaohuilam opened 6 years ago

xiaohuilam commented 6 years ago
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous 
where `lft` >= 1 and `lft` < 10 and `id` != 10 order by `table_a`.`lft` asc

Please provide a const or attribute in model declare class, to define primary key, or default primary key prefix with table name.

xiaohuilam commented 6 years ago

I commit this pull request: https://github.com/etrepat/baum/pull/286