Agree.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/12/14
  6. * Time: 18:19
  7. */
  8. namespace app\backend\modules\refund\services\steps;
  9. use app\common\models\refund\RefundApply;
  10. use app\common\services\steps\BaseStepFactory;
  11. class Agree extends BaseStepFactory
  12. {
  13. public function getTitle()
  14. {
  15. switch ($this->model->status) {
  16. case RefundApply::COMPLETE:
  17. $name = '售后(退款完成)';
  18. break;
  19. case RefundApply::CONSENSUS:
  20. $name = '售后(手动退款)';
  21. break;
  22. case RefundApply::CLOSE:
  23. $name = '售后(换货关闭)';
  24. break;
  25. default:
  26. $name = '售后完成';
  27. }
  28. return $name;
  29. }
  30. public function getDescription()
  31. {
  32. if ($this->finishStatus() && !is_null($this->model->refund_time)) {
  33. return $this->model->refund_time->toDateTimeString();
  34. }
  35. return '';
  36. }
  37. public function getStatus()
  38. {
  39. if ($this->finishStatus()) {
  40. return 'finish';
  41. } elseif ($this->processStatus()) {
  42. return 'process';
  43. } elseif ($this->waitStatus()) {
  44. return 'wait';
  45. }
  46. return 'error';
  47. }
  48. public function isShow()
  49. {
  50. return true;
  51. }
  52. public function waitStatus()
  53. {
  54. return $this->model->status < RefundApply::COMPLETE;
  55. }
  56. public function processStatus()
  57. {
  58. return false;
  59. }
  60. public function finishStatus()
  61. {
  62. return $this->model->status == RefundApply::COMPLETE ||
  63. $this->model->status == RefundApply::CONSENSUS ||
  64. $this->model->status == RefundApply::CLOSE;
  65. }
  66. public function sort()
  67. {
  68. return 99999;
  69. }
  70. }