Wx.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\shop\controller\plus\live;
  3. use app\shop\controller\Controller;
  4. use app\shop\model\plus\live\WxLive as WxLiveModel;
  5. /**
  6. * 微信小程序直播控制器
  7. */
  8. class Wx extends Controller
  9. {
  10. /**
  11. *直播列表
  12. */
  13. public function index()
  14. {
  15. $model = new WxLiveModel();
  16. $list = $model->getList($this->postData());
  17. return $this->renderSuccess('', compact('list'));
  18. }
  19. /**
  20. *直播列表同步
  21. */
  22. public function syn()
  23. {
  24. $model = new WxLiveModel();
  25. if($model->syn()){
  26. return $this->renderSuccess('操作成功');
  27. }
  28. return $this->renderError($model->getError() ?: '操作失败');
  29. }
  30. /**
  31. * 修改直播间置顶状态
  32. */
  33. public function settop($live_id)
  34. {
  35. // 直播间详情
  36. $model = WxLiveModel::detail($live_id);
  37. if (!$model->setTop($this->postData())) {
  38. return $this->renderError('操作失败');
  39. }
  40. return $this->renderSuccess('操作成功');
  41. }
  42. }