SupplierController.php 697 B

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