Send.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/12/9
  6. * Time: 15:15
  7. */
  8. namespace app\backend\modules\order\steps;
  9. class Send 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->send_time->toDateTimeString();
  22. }
  23. return parent::getDescription();
  24. }
  25. public function isShow()
  26. {
  27. return !($this->order->status == -1 && $this->order->send_time->toDateTimeString() == '1970-01-01 08:00:00');
  28. }
  29. public function waitStatus()
  30. {
  31. return $this->order->status < 1;
  32. }
  33. public function processStatus()
  34. {
  35. return $this->order->status == 1;
  36. }
  37. public function finishStatus()
  38. {
  39. return $this->order->send_time->toDateTimeString() != '1970-01-01 08:00:00';
  40. }
  41. public function sort()
  42. {
  43. return 20;
  44. }
  45. }