37 lines
706 B
PHP
37 lines
706 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use EloquentFilter\Filterable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Peidikeji\Keywords\Models\Keywords;
|
|
|
|
class CropFlow extends Model
|
|
{
|
|
use Filterable;
|
|
|
|
protected $fillable = [
|
|
'crop_id', 'flow_name', 'time_year', 'sale', 'user_id',
|
|
'created_by', 'updated_by'
|
|
];
|
|
|
|
/**
|
|
* 农作物
|
|
*
|
|
* @return void
|
|
*/
|
|
public function crop(){
|
|
return $this->belongsTo(Keywords::class, 'crop_id');
|
|
}
|
|
|
|
public function createdBy()
|
|
{
|
|
return $this->belongsTo(AdminUser::class, 'created_by');
|
|
}
|
|
|
|
public function updatedBy()
|
|
{
|
|
return $this->belongsTo(AdminUser::class, 'updated_by');
|
|
}
|
|
}
|