| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App;
- use App\Traits\ModelTimeFormat;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- class ProcurementTotalBill extends Model
- {
- use ModelLogChanging;
- use ModelTimeFormat;
- const status=[
- 0 => "未出账",
- 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);
- }
- }
|