GhsController.php 709 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace ghs\controllers;
  3. use biz\ghs\classes\GhsClass;
  4. use common\components\stringUtil;
  5. use Yii;
  6. use common\components\util;
  7. class GhsController extends BaseController
  8. {
  9. //供货商列表 ssh 2021.1.18
  10. public function actionList()
  11. {
  12. $get = Yii::$app->request->get();
  13. $name = isset($get['name']) ? $get['name'] : '';
  14. $where = ['ownShopId' => $this->shopId];
  15. if (!empty($name)) {
  16. if (stringUtil::isLetter($name)) {
  17. $where['py'] = ['like', $name];
  18. } else {
  19. $where['name'] = ['like', $name];
  20. }
  21. }
  22. $list = GhsClass::getGhsList($where);
  23. util::success($list);
  24. }
  25. }