| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- namespace business\controllers;
- use biz\order\services\OrderSendService;
- use biz\order\services\OrderService;
- use Yii;
- use common\components\util;
- use common\components\stringUtil;
- class OrderController extends BaseController
- {
-
- public function actionList()
- {
- $get = Yii::$app->request->get();
- //组建where
- $status = isset($get['status']) ? $get['status'] : 0;
- $search = isset($get['search']) ? $get['search'] : '';
- $where = ['merchantId' => $this->merchantId, 'status' => $status];
- if (!empty($search)) {
- if (stringUtil::isMobieNumber($search)) {
- $where['receiveMobile'] = $search;
- } else {
- $where['id'] = $search;
- }
- }
-
- $list = OrderService::getOrderList($where);
- util::success($list);
- }
-
- //订单详情 shish 2019.12.16
- public static function actionDetail()
- {
- $id = Yii::$app->request->get('id');
- $detail = OrderService::getDetail();
- util::success($detail);
- }
- //发货管理 shish 2019.11.30
- public function actionSendDetail()
- {
- $id = Yii::$app->request->get('id', 0);
- $order = OrderService::getById($id);
- OrderService::valid($order, $this->merchantId);
- $list = OrderSendService::sendDetail($id);
- util::success($list);
- }
-
- //发货流程更新 shish 2019.12.15
- public function actionSendUpdate()
- {
- $post = Yii::$app->request->post();
- $id = isset($post['id']) ? $post['id'] : 0;
- $actionId = isset($post['actionId']) ? $post['actionId'] : 0;
- $option = isset($post['option']) ? $post['option'] : 0;
- $order = OrderService::getById($id);
- OrderService::valid($order, $this->merchantId);
- OrderSendService::sendUpdate(['id' => $id, 'actionId' => $actionId, 'option' => $option]);
- util::ok('操作成功');
- }
-
- //打单 免填单 填单
- public function actionPrintOrder()
- {
- $post = Yii::$app->request->post();
- $id = isset($post['id']) ? $post['id'] : 0;
- $order = OrderService::getById($id);
- OrderService::valid($order, $this->merchantId);
- OrderSendService::printOrder(['id' => $id, 'option' => $option]);
- util::ok('操作成功');
- }
-
- //向快递公司发起配送需求
- public function actionExpress()
- {
-
- }
-
- //取消快递
- public function actionCancelExpress()
- {
- $sendSide = 1;
- $sendTime = '10:21';
- }
-
- //添加小费
- public function actionAddTip()
- {
-
- }
-
- //结果回调通知
- public function actionExpressCallback()
- {
-
- }
-
- //快递服务提供方
- public function actionExpressProvide()
- {
- $data = ['id' => 1, 'name' => '达达'];
- util::success($data);
- }
-
- }
|