RechargeOrder.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\common\model;
  20. use app\common\enum\PayEnum;
  21. use think\model\concern\SoftDelete;
  22. /**
  23. * 充值订单模型
  24. * Class RechargeOrder
  25. * @package app\common\model
  26. */
  27. class RechargeOrder extends BaseModel
  28. {
  29. use SoftDelete;
  30. protected $deleteTime = 'delete_time';
  31. /**
  32. * @notes 奖励获取器
  33. * @param $value
  34. * @return array|mixed
  35. * @author Tab
  36. * @date 2021/8/11 9:31
  37. */
  38. public function getAwardAttr($value)
  39. {
  40. if(empty($value)) {
  41. return [];
  42. }
  43. return json_decode($value, true);
  44. }
  45. /**
  46. * @notes 充值金额获取器
  47. * @param $value
  48. * @return int|mixed|string
  49. * @author Tab
  50. * @date 2021/8/11 15:11
  51. */
  52. public function getOrderAmountAttr($value)
  53. {
  54. return clear_zero($value);
  55. }
  56. /**
  57. * @notes 支付方式获取器
  58. * @param $value
  59. * @return string|string[]
  60. * @author Tab
  61. * @date 2021/8/11 15:59
  62. */
  63. public function getPayWayAttr($value)
  64. {
  65. return PayEnum::getPayDesc($value);
  66. }
  67. /**
  68. * @notes 支付状态获取器
  69. * @param $value
  70. * @return string|string[]
  71. * @author Tab
  72. * @date 2021/8/11 16:06
  73. */
  74. public function getPayStatusAttr($value)
  75. {
  76. return PayEnum::getPayStatusDesc($value);
  77. }
  78. }