1
0
Fork 0

Compare commits

..

No commits in common. "2660bd86bc3fdcd6ffef533176173b8aba6aabd6" and "d701d25b060fb3510e5bdaf3738f4e3f9bf42f67" have entirely different histories.

3 changed files with 3 additions and 10 deletions

View File

@ -9,8 +9,7 @@ class PlantHarvestLogFilter extends ModelFilter
/**
* 所属种植计划
*/
public function plant($plantId)
{
public function plant($plantId){
return $this->where('plant_id', $plantId);
}
}

View File

@ -51,7 +51,7 @@ class RegionController extends Controller
public function harvests($id, Request $request)
{
$info = Region::show()->findOrFail($id);
$query = $info->harvests()->filter($request->all());
$query = $info->harvests();
$per = $request->input('per_page');
if ($per == -1) {
$list = $query->get();

View File

@ -13,13 +13,7 @@ class PlantHarvestLog extends Model
'harvest_at' => 'datetime:Y-m-d',
];
public function plant()
{
public function plant(){
return $this->belongsTo(RegionPlantLog::class, 'plant_id');
}
public function modelFilter()
{
return \App\Filters\Admin\PlantHarvestLogFilter::class;
}
}