PlatformSettle.php 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. /**
  5. * PlatformSettle
  6. */
  7. class PlatformSettle extends Model
  8. {
  9. // 表名
  10. protected $name = 'platform_settle';
  11. // 自动写入时间戳字段
  12. protected $autoWriteTimestamp = true;
  13. public function getTotalAmountAttr($value): float
  14. {
  15. return (float)$value;
  16. }
  17. public function getSettledAmountAttr($value): float
  18. {
  19. return (float)$value;
  20. }
  21. public function getBackingInvoiceAmountAttr($value): float
  22. {
  23. return (float)$value;
  24. }
  25. public function getInvoicedAmountAttr($value): float
  26. {
  27. return (float)$value;
  28. }
  29. public function getDoingInvoiceAmountAttr($value): float
  30. {
  31. return (float)$value;
  32. }
  33. public function xuqiuOrder()
  34. {
  35. return $this->belongsTo(\app\admin\model\XuqiuOrder::class, 'order_id', 'id');
  36. }
  37. public function supplier()
  38. {
  39. return $this->belongsTo(\app\admin\model\Supplier::class, 'supplier_id', 'id');
  40. }
  41. }