OrderController.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 function actionDetail()
  29. {
  30. $id = Yii::$app->request->get('id');
  31. $detail = OrderService::getDetail();
  32. util::success($detail);
  33. }
  34. //发货管理 shish 2019.12.16
  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.16
  44. public function actionPrintOrder()
  45. {
  46. $post = Yii::$app->request->post();
  47. $id = isset($post['id']) ? $post['id'] : 0;
  48. $option = isset($post['option']) ? $post['option'] : 0;
  49. $order = OrderService::getById($id);
  50. OrderService::valid($order, $this->merchantId);
  51. OrderSendService::printOrder(['id' => $id, 'option' => $option]);
  52. util::ok('操作成功');
  53. }
  54. //向快递公司发起配送需求
  55. public function actionExpress()
  56. {
  57. }
  58. //取消快递
  59. public function actionCancelExpress()
  60. {
  61. $sendSide = 1;
  62. $sendTime = '10:21';
  63. }
  64. //添加小费
  65. public function actionAddTip()
  66. {
  67. }
  68. //结果回调通知
  69. public function actionExpressCallback()
  70. {
  71. }
  72. //快递服务提供方
  73. public function actionExpressProvide()
  74. {
  75. $data = ['id' => 1, 'name' => '达达'];
  76. util::success($data);
  77. }
  78. }