GhsController.php 941 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. public function actionAdd()
  10. {
  11. $data = [
  12. 'id' => 2,
  13. 'name' => '小石头',
  14. 'avatar' => 'https://img.hzghd.com/ghs/home/deserve.png',
  15. ];
  16. util::success($data);
  17. }
  18. //供货商列表 ssh 2021.1.18
  19. public function actionList()
  20. {
  21. $get = Yii::$app->request->get();
  22. $name = isset($get['name']) ? $get['name'] : '';
  23. $where = ['ownShopId' => $this->shopId];
  24. if (!empty($name)) {
  25. if (stringUtil::isLetter($name)) {
  26. $where['py'] = ['like', $name];
  27. } else {
  28. $where['name'] = ['like', $name];
  29. }
  30. }
  31. $list = GhsClass::getGhsList($where);
  32. util::success($list);
  33. }
  34. }