SupplierController.php 786 B

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