SeparateSend.php 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/12/21
  6. * Time: 9:51
  7. */
  8. namespace app\backend\modules\order\operations;
  9. class SeparateSend extends BackendOrderBase
  10. {
  11. public function getApi()
  12. {
  13. return 'order.vue-operation.separate-send';
  14. }
  15. public function getName()
  16. {
  17. if ($this->order->status == 1) {
  18. return '多包裹发货';
  19. }
  20. return '继续发货';
  21. }
  22. public function getValue()
  23. {
  24. return 'separate_send';
  25. }
  26. public function enable()
  27. {
  28. //只有标准订单支持多包裹发货
  29. if ($this->order->plugin_id != 0) {
  30. return false;
  31. }
  32. //已发完货
  33. if ($this->order->status == 2 && $this->order->is_all_send_goods != 1) {
  34. return false;
  35. }
  36. return true;
  37. }
  38. public function getType()
  39. {
  40. return self::TYPE_PRIMARY;
  41. }
  42. }