feat: 项目基础框架+配置+Kernel
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class InsuranceRule extends Model
|
||||
{
|
||||
//
|
||||
protected $table = 'insurance_rules';
|
||||
protected $appends=['insurance_name'];
|
||||
public $timestamps=false;
|
||||
|
||||
public function getInsuranceNameAttribute()
|
||||
{
|
||||
|
||||
$res=$this->belongsTo('App\InsuranceType', 'insurance_type_id', 'id')->value('name');
|
||||
if(empty($res)) {
|
||||
$res="";
|
||||
}
|
||||
return $res;
|
||||
|
||||
}
|
||||
public function insuranceType()
|
||||
{
|
||||
return $this->belongsTo('App\InsuranceType', 'insurance_type_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user