L
`
public function weights(){
return $this->hasMany(Weight::class, 'product_id', 'id')->where('status', 1);
}
`
Есть запрос:
`$product = $product->join('weight', 'weight.product_id', '=', 'product.id')
->orderBy('weight.price', 'ASC')
->with('weight')
->select('product.*');
`
Пишет ошибку:
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous (SQL: select count(*) as aggregate from `product
inner join weight
on weight
.product_id
= product
.id
where exists (select * from catshop
where product
.id
= catshop
.product_id
and (podcat
= 369 or podpodcat
= 369)) and status
= 1)`Помогите исправить