VideoGroup.php 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\logic\VideoGroupLogic;
  4. use app\BaseController;
  5. use think\exception\ValidateException;
  6. use think\facade\Config;
  7. use think\facade\Validate;
  8. //批量设置视频
  9. class VideoGroup extends BaseController
  10. {
  11. //列表
  12. public function list()
  13. {
  14. $param = $this->request->only([
  15. 'page' => 1,
  16. 'size' => 10,
  17. 'company_title' => '',
  18. 'card_title' => '',
  19. 'code' => '',
  20. 'start_date' => '',
  21. 'end_date' => '',
  22. ], 'post');
  23. return VideoGroupLogic::list($param);
  24. }
  25. //添加
  26. public function add()
  27. {
  28. $param = $this->request->only(['group_id', 'video_ids'], 'post');
  29. $val = Validate::rule(Config::get('validate_rules.videoGroupAdd'));
  30. if (!$val->check($param)) throw new ValidateException($val->getError());
  31. return VideoGroupLogic::add($param);
  32. }
  33. }