| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace business\controllers;
- 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.17
- public function actionClassify()
- {
- $post = Yii::$app->request->post();
- $id = isset($post['id']) ? $post['id'] : 0;
- $order = OrderService::getById($id);
- OrderService::valid($order, $this->merchantId);
- $categoryId = isset($post['categoryId']) ? $post['categoryId'] : $post['categoryId'];
- $usageId = isset($post['usageId']) ? $post['usageId'] : $post['usageId'];
- OrderService::classify($id, $categoryId, $usageId);
- util::ok();
- }
- }
|