CommonController.php 914 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. *
  4. * @file:CommonController.php
  5. * @Date: 2023/7/6
  6. * @Time: 18:05
  7. */
  8. namespace Modules\WechatPlatform\Http\Controllers;
  9. use Catch\Base\CatchController;
  10. use Catch\Exceptions\FailedException;
  11. use Illuminate\Support\Facades\DB;
  12. use Modules\WechatPlatform\Http\Requests\PlayPageUrlRequest;
  13. use Modules\WechatPlatform\Services\WechatCommonService;
  14. class CommonController extends CatchController
  15. {
  16. public function getPlayPageUrl(PlayPageUrlRequest $request)
  17. {
  18. $sequence = $request->input('sequence');
  19. $videoId = $request->input('video_id');
  20. $sequenceId = DB::table('video_series')->where('video_id',$videoId)->where('series_sequence',$sequence)->where('is_enabled',1)->value('id');
  21. if(empty($sequenceId)){
  22. throw new FailedException("所选剧集不存在");
  23. }
  24. return WechatCommonService::getPlayPageUrl($videoId,$sequence);
  25. }
  26. }