ExpressInfo.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. use app\common\models\DispatchType;
  11. class ExpressInfo extends OrderOperation
  12. {
  13. public function getApi()
  14. {
  15. if ($this->order->is_all_send_goods) {
  16. return 'dispatch.express.get-order-multiple-packages';
  17. }
  18. return 'dispatch.express';
  19. }
  20. public function getName()
  21. {
  22. return '物流信息';
  23. }
  24. public function getValue()
  25. {
  26. return static::EXPRESS;
  27. }
  28. public function enable()
  29. {
  30. // 虚拟
  31. if ($this->order->isVirtual() || $this->order->isBlindBox()) {
  32. return false;
  33. }
  34. // todo 这里要修改,不然每次有新的都得往这加
  35. // 门店自提、配送站自提、配送站送货
  36. $dispatchType = [
  37. DispatchType::SELF_DELIVERY,
  38. DispatchType::DELIVERY_STATION_SELF,
  39. DispatchType::DELIVERY_STATION_SEND,
  40. DispatchType::STORE_PACKAGE_DELIVER
  41. ];
  42. if (in_array($this->order->dispatch_type_id, $dispatchType)) {
  43. return false;
  44. }
  45. return true;
  46. }
  47. }