调整产量数据查询

dev
vine_liutk 2022-11-08 14:44:56 +08:00
parent 8f9aaf7669
commit 3ea56b7d68
1 changed files with 7 additions and 0 deletions

View File

@ -17,4 +17,11 @@ class CropYieldFilter extends ModelFilter
{
return $this->where('crop_id', $cropId);
}
public function type($type)
{
return $this->whereHas('base', function($q) use ($type) {
return $q->where('type', $type);
});
}
}