Crecord.php 1.8 KB

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