Share.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\admin\controller\platform;
  3. use app\common\controller\Backend;
  4. /**
  5. * 第三方平台列表
  6. *
  7. */
  8. class Share extends Backend
  9. {
  10. protected $relationSearch = true;
  11. protected $model = null;
  12. public function _initialize()
  13. {
  14. parent::_initialize();
  15. // $this->model = new \app\admin\model\third\Platform;
  16. $this->model = new \app\common\model\VideoShare;
  17. // $this->model = model('platform');
  18. }
  19. /**
  20. * 查看
  21. */
  22. public function index()
  23. {
  24. //设置过滤方法
  25. $this->request->filter(['strip_tags']);
  26. if ($this->request->isAjax()) {
  27. //如果发送的来源是Selectpage,则转发到Selectpage
  28. if ($this->request->request('keyField')) {
  29. return $this->selectpage();
  30. }
  31. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  32. if(input('vid')){
  33. $map['video_share.vid']= input('vid');
  34. }
  35. if(input('uid')){
  36. $map['video_share.uid']= input('uid');
  37. }
  38. $total = $this->model
  39. ->where($where)
  40. ->order($sort, $order)
  41. ->count();
  42. $list = $this->model
  43. ->where($where)
  44. ->with('user,videolist')
  45. ->order($sort, $order)
  46. ->limit($offset, $limit)
  47. ->select();
  48. $result = array("total" => $total, "rows" => $list);
  49. return json($result);
  50. }
  51. return $this->view->fetch();
  52. }
  53. /**
  54. * 编辑
  55. */
  56. // public function edit($ids = NULL)
  57. // {
  58. // $row = $this->model->get($ids);
  59. // if (!$row)
  60. // $this->error(__('No Results were found'));
  61. // return parent::edit($ids);
  62. // }
  63. // public function add()
  64. // {
  65. // return parent::add();
  66. // }
  67. }