Close.php 619 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2018/8/1
  6. * Time: 下午6:43
  7. */
  8. namespace app\frontend\modules\order\operations\member;
  9. use app\frontend\modules\order\operations\OrderOperation;
  10. class Close extends OrderOperation
  11. {
  12. public function getApi()
  13. {
  14. return 'order.operation.close';
  15. }
  16. public function getName()
  17. {
  18. return '取消订单';
  19. }
  20. public function getValue()
  21. {
  22. return static::CANCEL;
  23. }
  24. public function enable()
  25. {
  26. if ($this->order->isPending()) {
  27. return false;
  28. }
  29. return true;
  30. }
  31. }