43 lines
779 B
PHP
43 lines
779 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use EloquentFilter\Filterable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Peidikeji\Keywords\Models\Keywords;
|
|
|
|
class CropYield extends Model
|
|
{
|
|
use Filterable;
|
|
|
|
protected $fillable = ['base_id', 'crop_id', 'time_year', 'yield', 'cultivated', 'output', 'user_id'];
|
|
|
|
/**
|
|
* 基地
|
|
*
|
|
* @return void
|
|
*/
|
|
public function base(){
|
|
return $this->belongsTo(AgriculturalBase::class, 'base_id');
|
|
}
|
|
|
|
/**
|
|
* 农作物
|
|
*
|
|
* @return void
|
|
*/
|
|
public function crop(){
|
|
return $this->belongsTo(Keywords::class, 'crop_id');
|
|
}
|
|
|
|
/**
|
|
* 录入人
|
|
*
|
|
* @return void
|
|
*/
|
|
public function user(){
|
|
return $this->belongsTo(AdminUser::class, 'user_id');
|
|
}
|
|
|
|
}
|