OrderStepFactory.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/12/9
  6. * Time: 14:03
  7. */
  8. namespace app\backend\modules\order\steps;
  9. use app\common\models\Order;
  10. use app\common\services\steps\interfaces\ElementSteps;
  11. abstract class OrderStepFactory implements ElementSteps
  12. {
  13. protected $order;
  14. public function __construct(Order $order)
  15. {
  16. $this->order = $order;
  17. }
  18. /**
  19. * 标题
  20. * @return string
  21. */
  22. public function getTitle()
  23. {
  24. return '';
  25. }
  26. /**
  27. * 描述性文字
  28. * @return string
  29. */
  30. public function getDescription()
  31. {
  32. return '';
  33. }
  34. /**
  35. * 图标
  36. * @return string
  37. */
  38. public function getIcon()
  39. {
  40. return '';
  41. }
  42. /**
  43. * 指定返回 wait|process|finish|error|success
  44. * @return string
  45. */
  46. public function getStatus()
  47. {
  48. if ($this->finishStatus()) {
  49. return 'finish';
  50. } elseif ($this->processStatus()) {
  51. return 'process';
  52. } elseif ($this->waitStatus()) {
  53. return 'wait';
  54. }
  55. return 'error';
  56. }
  57. public function isShow()
  58. {
  59. return true;
  60. }
  61. public function getValue()
  62. {
  63. return $this->sort();
  64. }
  65. /**
  66. * 排序
  67. * @return int
  68. */
  69. public function sort()
  70. {
  71. return 0;
  72. }
  73. /**
  74. * 等待状态
  75. * @return boolean
  76. */
  77. abstract function waitStatus();
  78. /**
  79. * 处理中状态
  80. * @return boolean
  81. */
  82. abstract function processStatus();
  83. /**
  84. * 完成状态
  85. * @return boolean
  86. */
  87. abstract function finishStatus();
  88. }