SaasOrderLife.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace app\model\saas;
  3. use app\extra\basic\Model;
  4. /**
  5. * @property integer $id (主键)
  6. * @property string $open_id
  7. * @property integer $agent_id 代理id
  8. * @property integer $store_id 店铺id
  9. * @property string $order_id
  10. * @property string $product_name
  11. * @property integer $out_id 来客商品ID
  12. * @property integer $order_amount 订单金额
  13. * @property integer $pay_amount 实际支付金额
  14. * @property mixed $pay_at 支付时间
  15. * @property mixed $refund_at 退款时间
  16. * @property mixed $refund_apply_at 退款申请时间
  17. * @property integer $intention_poi_id 下单门店
  18. * @property string $mobile
  19. * @property integer $count
  20. * @property integer $status
  21. * @property integer $is_send 1已发送过短信
  22. * @property string $remark
  23. * @property mixed $create_at
  24. */
  25. class SaasOrderLife extends Model
  26. {
  27. /**
  28. * The connection name for the model.
  29. *
  30. * @var string|null
  31. */
  32. protected $connection = 'mysql';
  33. /**
  34. * The table associated with the model.
  35. *
  36. * @var string
  37. */
  38. protected string $table = "saas_order_life";
  39. /**
  40. * The primary key associated with the table.
  41. *
  42. * @var string
  43. */
  44. protected string $primaryKey = "id";
  45. /**
  46. * Indicates if the model should be timestamped.
  47. *
  48. * @var bool
  49. */
  50. public bool $timestamps = false;
  51. public function getOrderAmountAttr($data): string
  52. {
  53. if ($data == 0) return 0;
  54. return format_money($data/100);
  55. }
  56. public function getPayAmountAttr($data): string
  57. {
  58. if ($data == 0) return 0;
  59. return format_money($data/100);
  60. }
  61. }