IndexController.php 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\plugins\wxlive\controllers\client;
  8. use app\plugins\wxlive\models\client\LiveForm;
  9. class IndexController
  10. {
  11. /**
  12. * 获取直播间列表
  13. * @return array
  14. */
  15. public function actionGetLIst()
  16. {
  17. $liveForm = new LiveForm();
  18. $liveForm->store_id = get_store_id();
  19. $liveForm->page = get_params('page',1);
  20. $liveForm->limit = get_params('limit',20);
  21. $res = $liveForm->getList();
  22. if ($res['errcode'] > 0) {
  23. return [
  24. 'code' => 1,
  25. 'msg' => $res['errmsg'],
  26. ];
  27. }
  28. return [
  29. 'code' => 0,
  30. 'data' => [
  31. 'total' => $res['total'],
  32. 'list' => $res['room_info']
  33. ]
  34. ];
  35. }
  36. }