OrderController.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. namespace business\controllers;
  3. use biz\order\services\OrderSendService;
  4. use biz\order\services\OrderService;
  5. use Yii;
  6. use common\components\util;
  7. use common\components\stringUtil;
  8. class OrderController extends BaseController
  9. {
  10. public function actionList()
  11. {
  12. $get = Yii::$app->request->get();
  13. //组建where
  14. $status = isset($get['status']) ? $get['status'] : 0;
  15. $search = isset($get['search']) ? $get['search'] : '';
  16. $where = ['merchantId' => $this->merchantId, 'status' => $status];
  17. if (!empty($search)) {
  18. if (stringUtil::isMobieNumber($search)) {
  19. $where['receiveMobile'] = $search;
  20. } else {
  21. $where['id'] = $search;
  22. }
  23. }
  24. $list = OrderService::getOrderList($where);
  25. util::success($list);
  26. }
  27. //订单详情 shish 2019.12.16
  28. public static function actionDetail()
  29. {
  30. $id = Yii::$app->request->get('id');
  31. $detail = OrderService::getDetail();
  32. util::success($detail);
  33. }
  34. //发货管理 shish 2019.11.30
  35. public function actionSendDetail()
  36. {
  37. $id = Yii::$app->request->get('id', 0);
  38. $order = OrderService::getById($id);
  39. OrderService::valid($order, $this->merchantId);
  40. $list = OrderSendService::sendDetail($id);
  41. util::success($list);
  42. }
  43. //发货流程更新 shish 2019.12.15
  44. public function actionSendUpdate()
  45. {
  46. $post = Yii::$app->request->post();
  47. $id = isset($post['id']) ? $post['id'] : 0;
  48. $actionId = isset($post['actionId']) ? $post['actionId'] : 0;
  49. $option = isset($post['option']) ? $post['option'] : 0;
  50. $order = OrderService::getById($id);
  51. OrderService::valid($order, $this->merchantId);
  52. OrderSendService::sendUpdate(['id' => $id, 'actionId' => $actionId, 'option' => $option]);
  53. util::ok('操作成功');
  54. }
  55. //打单 免填单 填单
  56. public function actionPrintOrder()
  57. {
  58. $post = Yii::$app->request->post();
  59. $id = isset($post['id']) ? $post['id'] : 0;
  60. $order = OrderService::getById($id);
  61. OrderService::valid($order, $this->merchantId);
  62. OrderSendService::printOrder(['id' => $id, 'option' => $option]);
  63. util::ok('操作成功');
  64. }
  65. //向快递公司发起配送需求
  66. public function actionExpress()
  67. {
  68. }
  69. //取消快递
  70. public function actionCancelExpress()
  71. {
  72. $sendSide = 1;
  73. $sendTime = '10:21';
  74. }
  75. //添加小费
  76. public function actionAddTip()
  77. {
  78. }
  79. //结果回调通知
  80. public function actionExpressCallback()
  81. {
  82. }
  83. //快递服务提供方
  84. public function actionExpressProvide()
  85. {
  86. $data = ['id' => 1, 'name' => '达达'];
  87. util::success($data);
  88. }
  89. }