"未出账", 1 => "已出账", 2 => "已完结", ]; protected $fillable=[ 'counting_month','supplier_id','status','total_payable' ]; public function supplier(){ return $this->belongsTo('App\Supplier','supplier_id','id'); } //截取账单日期为月 public function getCountingMonthAttribute($value) { return substr($value,0,7); } }