RechargeOrder.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\common\model\recharge;
  15. use app\common\enum\PayEnum;
  16. use app\common\model\BaseModel;
  17. use app\common\model\works\ServiceWork;
  18. use think\model\concern\SoftDelete;
  19. /**
  20. * 订单模型
  21. * Class RechargeOrder
  22. * @package app\common\model
  23. */
  24. class RechargeOrder extends BaseModel
  25. {
  26. use SoftDelete;
  27. protected $deleteTime = 'delete_time';
  28. /**
  29. * @notes 支付方式
  30. * @param $value
  31. * @return string|string[]
  32. * @author 段誉
  33. * @date 2023/2/23 18:32
  34. */
  35. public function getPayWayTextAttr($value, $data)
  36. {
  37. return PayEnum::getPayDesc($data['pay_way']);
  38. }
  39. /**
  40. * @notes 支付状态
  41. * @param $value
  42. * @return string|string[]
  43. * @author 段誉
  44. * @date 2023/2/23 18:32
  45. */
  46. public function getPayStatusTextAttr($value, $data)
  47. {
  48. return PayEnum::getPayStatusDesc($data['pay_status']);
  49. }
  50. public function serviceWork()
  51. {
  52. return $this->belongsTo(ServiceWork::class, 'work_id', 'id');
  53. }
  54. public function orderGoods()
  55. {
  56. return $this->hasOne(OrderGoods::class, 'sn', 'sn');
  57. }
  58. }