You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.9 KiB

  1. <?php
  2. declare (strict_types=1);
  3. namespace App\Model;
  4. /**
  5. */
  6. class FinancialRecord extends Model
  7. {
  8. /**
  9. * 当面付商户首单奖励限制的订单金额
  10. */
  11. const OFL_FIRST_AWARD_LIMIT_AMOUNT = 3;
  12. /**
  13. * 虚拟账户
  14. */
  15. const ACCOUNT_LEDGER = -1;
  16. /**
  17. * 账户类型
  18. *
  19. * 总账
  20. * USER_TYPE_LEDGER / -1
  21. *
  22. * 用户
  23. * USER_TYPE_USER / 1
  24. *
  25. * MP用户账户,服务商、市场经理、服务站点等
  26. * USER_TYPE_MP / 2
  27. * USER_TYPE_MM / 3
  28. * USER_TYPE_CS / 4
  29. *
  30. * 商户账户
  31. * USER_TYPE_STORE / 5
  32. */
  33. const USER_TYPE_LEDGER = -1;
  34. const USER_TYPE_USER = 1;
  35. const USER_TYPE_MP = 2;
  36. const USER_TYPE_MM = 3;
  37. const USER_TYPE_CS = 4;
  38. const USER_TYPE_STORE = 5;
  39. /**
  40. * 关联类型
  41. *
  42. * 订单
  43. * SOURCE_TYPE_ORDER / 1
  44. */
  45. const SOURCE_TYPE_ORDER = 1;
  46. /**
  47. * 流水类型,大的分类,<100是奖励分账等收入项 >=100是提现消费等支出项
  48. */
  49. const MONEY_TYPE_CS_PLAT_NEW_USER = 1; // 社区服务点新用户奖励(线上订单完成)
  50. const MONEY_TYPE_CS_FIRST_ORDER = 2; // 社区服务点新用户线上首单奖励(线上订单完成)
  51. const MONEY_TYPE_CS_OL_ORDER = 3; // 社区服务点用户线上订单分账(线上订单完成)
  52. const MONEY_TYPE_STORE_PLAT_NEW_USER = 4; // 商户平台新用户奖励
  53. const MONEY_TYPE_STORE_FIRST_ORDER = 5; // 商户当日首单奖励
  54. const MONEY_TYPE_STORE_OL_ORDER_COMP = 6; // 商户线上订单完成收入
  55. const MONEY_TYPE_STORE_OFL_ORDER_COMP = 7; // 商户线下订单完成收入
  56. const MONEY_TYPE_USER_OL_ORDER_REFUND = 8; // 用户线上订单退款
  57. const MONEY_TYPE_MM_PLAT_NEW_USER = 9; // 市场经理发展新用户
  58. const MONEY_TYPE_MM_PLAT_NEW_STORE = 10; // 市场经理发展新商户
  59. const MONEY_TYPE_MP_PLAT_NEW_USER = 11; // 服务商发展新用户
  60. const MONEY_TYPE_MP_PLAT_NEW_STORE = 12; // 服务商发展新商户
  61. const MONEY_TYPE_MP_OL_ORDER = 13; // 服务商线上订单分账(线上订单完成)
  62. const MONEY_TYPE_USER_OFL_ORDER = 100; // 用户线下支付订单
  63. const MONEY_TYPE_USER_OL_ORDER = 101; // 用户线上支付订单
  64. /**
  65. * 状态
  66. */
  67. const STATUS_NORMAL = 1;
  68. const STATUS_ABNORMAL = 2;
  69. /**
  70. * The table associated with the model.
  71. *
  72. * @var string
  73. */
  74. protected $table = 'lanzu_financial_record';
  75. /**
  76. * The attributes that are mass assignable.
  77. *
  78. * @var array
  79. */
  80. protected $fillable = [
  81. 'user_id',
  82. 'user_type',
  83. 'money',
  84. 'money_type',
  85. 'source_id',
  86. 'source_type',
  87. 'desc',
  88. 'comment',
  89. 'status',
  90. ];
  91. /**
  92. * The attributes that should be cast to native types.
  93. *
  94. * @var array
  95. */
  96. protected $casts = [];
  97. }