| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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 function actionDetail()
- {
- $id = Yii::$app->request->get('id');
- $detail = OrderService::getDetail();
- util::success($detail);
- }
-
- //发货管理 shish 2019.12.16
- 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.16
- public function actionPrintOrder()
- {
- $post = Yii::$app->request->post();
- $id = isset($post['id']) ? $post['id'] : 0;
- $option = isset($post['option']) ? $post['option'] : 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);
- }
-
- }
|