CustomController.php 969 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\custom\services\CustomService;
  4. use common\components\stringUtil;
  5. use common\components\util;
  6. use Yii;
  7. use yii\web\Controller;
  8. class CustomController extends BaseController
  9. {
  10. //客户列表 shish 2021.7.8
  11. public function actionList()
  12. {
  13. $get = Yii::$app->request->get();
  14. $type = isset($get['type']) ? $get['type'] : -1;
  15. $name = isset($get['name']) ? $get['name'] : '';
  16. $where = ['ghsId' => $this->ghsId];
  17. switch ($type) {
  18. case 1:
  19. //已开店
  20. $where['isOpen'] = 1;
  21. break;
  22. default:
  23. }
  24. if (!empty($name)) {
  25. if (stringUtil::isMobile($name)) {
  26. $where['mobile'] = $name;
  27. } else {
  28. $where['shopName'] = ['like', $name];
  29. }
  30. }
  31. $list = CustomService::getCustomList($where);
  32. util::success($list);
  33. }
  34. }