OwnerBillReport.php 765 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class OwnerBillReport extends Model
  6. {
  7. use ModelLogChanging;
  8. protected $fillable = [
  9. "owner_id", //项目ID
  10. "counting_month", //结算月
  11. "initial_fee", //原始账单金额
  12. "confirm_fee", //确认账单金额
  13. "difference", //差额
  14. "confirmed", //确认状态
  15. ];
  16. public $timestamps=false;
  17. public function owner()
  18. { //货主
  19. return $this->hasOne(Owner::class,"id","owner_id");
  20. }
  21. /* 结算月格式转换,仅截取至月
  22. * 引用:CreateOwnerReport
  23. */
  24. public function getCountingMonthAttribute($value)
  25. {
  26. return substr($value,0,7);
  27. }
  28. }