HdController.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace mall\controllers;
  3. use bizHd\custom\classes\HdClass;
  4. use common\components\util;
  5. use bizHd\custom\classes\CustomClass;
  6. class HdController extends BaseController
  7. {
  8. //花店信息 ssh 20230111
  9. public function actionInfo()
  10. {
  11. $user = $this->user;
  12. if (empty($user)) {
  13. util::success(['hd' => $this->shop]);
  14. } else {
  15. $respond = CustomClass::buildRelation($this->shop, $user);
  16. $hd = $respond['hd'];
  17. util::success(['hd' => $hd]);
  18. }
  19. }
  20. public function actionList()
  21. {
  22. $showGlInfo = getenv('SHOW_GL_INFO');
  23. $info = $showGlInfo === false ? 1 : $showGlInfo;
  24. if (isset($this->userId) == false || empty($this->userId)) {
  25. util::success(['list' => [], 'showGlInfo' => $info]);
  26. }
  27. $where = [];
  28. $where['userId'] = $this->userId;
  29. $where['delStatus'] = 0;
  30. $respond = HdClass::getHdList($where);
  31. $respond['showGlInfo'] = $info;
  32. util::success($respond);
  33. }
  34. }