Refunded.php 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2018/8/2
  6. * Time: 下午5:51
  7. */
  8. namespace app\frontend\modules\order\operations\member;
  9. use app\frontend\modules\order\operations\OrderOperation;
  10. use app\frontend\modules\refund\models\RefundApply;
  11. class Refunded extends OrderOperation
  12. {
  13. public function getApi()
  14. {
  15. return 'refund.detail';
  16. }
  17. public function getValue()
  18. {
  19. return static::REFUND_INFO;
  20. }
  21. public function getName()
  22. {
  23. if ($this->order->hasOneRefundApply &&
  24. $this->order->hasOneRefundApply->refund_type == RefundApply::REFUND_TYPE_EXCHANGE_GOODS) {
  25. return '已换货';
  26. }
  27. return '已退款';
  28. }
  29. public function enable()
  30. {
  31. //2018-8-30 租赁订单不能退款
  32. if ($this->order->plugin_id == 40) {
  33. return false;
  34. }
  35. return $this->order->isRefunded();
  36. }
  37. }