OrderController.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace admin\controllers;
  3. use biz\order\services\OrderService;
  4. use Yii;
  5. use yii\data\Pagination;
  6. use yii\helpers\Json;
  7. use common\models\xhOrder;
  8. use common\models\xhOrderGoods;
  9. use common\components\util;
  10. use common\components\stringUtil;
  11. use common\components\weixinUtil;
  12. use common\services\xhOrderService;
  13. use common\services\xhGoodsService;
  14. use common\services\xhTMessageService;
  15. use common\services\xhUserService;
  16. use common\services\xhUserAlipayService;
  17. use common\components\page;
  18. use common\components\configDict;
  19. class OrderController extends BaseController
  20. {
  21. public $enableCsrfValidation = false;
  22. public function actionList()
  23. {
  24. $get = Yii::$app->request->get();
  25. //组建where
  26. $status = isset($get['status']) ? $get['status'] : 0;
  27. $search = isset($get['search']) ? $get['search'] : '';
  28. $where = ['merchantId' => $this->merchantId, 'status' => $status];
  29. if (!empty($search)) {
  30. if (stringUtil::isMobieNumber($search)) {
  31. $where['receiveMobile'] = $search;
  32. } else {
  33. $where['id'] = $search;
  34. }
  35. }
  36. //传递page pageSize参数
  37. $page = isset($get['page']) ? $get['page'] : 1;
  38. Yii::$app->params['page'] = $page;
  39. $list = OrderService::getList('*', $where, 'addTime DESC');
  40. util::success($list);
  41. }
  42. }