Pay.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/12/9
  6. * Time: 15:14
  7. */
  8. namespace app\backend\modules\order\steps;
  9. class Pay extends OrderStepFactory
  10. {
  11. public function getTitle()
  12. {
  13. if (!$this->finishStatus()) {
  14. return '待支付';
  15. }
  16. return '支付时间';
  17. }
  18. public function getDescription()
  19. {
  20. if ($this->finishStatus()) {
  21. return $this->order->pay_time->toDateTimeString();
  22. }
  23. return parent::getDescription();
  24. }
  25. public function getStatus()
  26. {
  27. if ($this->finishStatus()) {
  28. return 'finish';
  29. } elseif ($this->processStatus()) {
  30. return 'process';
  31. } elseif ($this->waitStatus()) {
  32. return 'wait';
  33. }
  34. return 'error';
  35. }
  36. public function isShow()
  37. {
  38. return !($this->order->status == -1 && $this->order->pay_time->toDateTimeString() == '1970-01-01 08:00:00');
  39. }
  40. public function waitStatus()
  41. {
  42. return $this->order->status < 1;
  43. }
  44. public function processStatus()
  45. {
  46. return $this->order->status == 1;
  47. }
  48. public function finishStatus()
  49. {
  50. return $this->order->pay_time->toDateTimeString() !='1970-01-01 08:00:00';
  51. }
  52. public function sort()
  53. {
  54. return 10;
  55. }
  56. }