VideoComment.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. namespace app\Nutrition\controller;
  3. use app\common\model\DatumIntro;
  4. use app\common\model\VideoIntro;
  5. use library\Controller;
  6. use app\common\model\VideoCate;
  7. use function AlibabaCloud\Client\value;
  8. /**
  9. * 视频评论
  10. * Class VideoComment
  11. * @package app\Nutrition\controller
  12. */
  13. class VideoComment extends Controller
  14. {
  15. /**
  16. * 绑定数据表
  17. * @var string
  18. */
  19. protected $table = 'VideoComment';
  20. /**
  21. * 列表
  22. * @auth true
  23. * @menu true
  24. * @throws \think\Exception
  25. * @throws \think\db\exception\DataNotFoundException
  26. * @throws \think\db\exception\ModelNotFoundException
  27. * @throws \think\exception\DbException
  28. * @throws \think\exception\PDOException
  29. */
  30. public function index()
  31. {
  32. $this->title = '视频列表';
  33. $this->video_id = input('video_id');
  34. $this->url_id = input('url_id');
  35. $sel_where = [];
  36. $sel_where[] = ['c.is_deleted','=',0];
  37. $sel_where[] = ['c.video_id','=',$this->video_id];
  38. $sel_where[] = ['c.url_id','=',$this->url_id];
  39. $query = $this->_query($this->table)->alias('c')
  40. ->field('c.*,u.name,u.headimg')
  41. ->leftJoin("store_member u",'u.id = c.user_id')
  42. ->where($sel_where)->order('id desc')->page();
  43. }
  44. /**
  45. * 数据列表处理
  46. * @auth true
  47. * @menu true
  48. * @param array $data
  49. * @throws \think\db\exception\DataNotFoundException
  50. * @throws \think\db\exception\ModelNotFoundException
  51. * @throws \think\exception\DbException
  52. */
  53. protected function _index_page_filter(&$data)
  54. {
  55. }
  56. /**
  57. * 删除
  58. * @auth true
  59. * @menu true
  60. * @throws \think\Exception
  61. * @throws \think\db\exception\DataNotFoundException
  62. * @throws \think\db\exception\ModelNotFoundException
  63. * @throws \think\exception\DbException
  64. * @throws \think\exception\PDOException
  65. */
  66. public function del()
  67. {
  68. $this->_save($this->table, ['is_deleted' => 1]);
  69. }
  70. /**
  71. * 表单数据处理
  72. * @auth true
  73. * @menu true
  74. * @param array $data
  75. */
  76. protected function _form_filter(&$data)
  77. {
  78. }
  79. }