您好,有人可以帮我吗,可以仅接受不包含音频或视频的问题,而忽略那些包含音频或视频的问题:
这是我的控制器的一部分:
public function generateTestPdf(Request $request){
$test_id = $request['test_id'];
$test = Test::where('id', $test_id)->first();
$test_info = (new TestInfoController)->testInfo($test_id);
$test_questions = (new TestQuestionsController)->questionwithanswers($test_id, $randomorder = 1);
.
.
.
and so on..
此$test_questions
的结果是我死了转储时的结果,我有两个问题,一个包含音频,另一个没有音频,我希望能够忽略音频的问题,不要接受。我该如何发表信息并说不包括音频和视频,以及不包括音频和视频?
答案 0 :(得分:0)
修改您的questionwithanswers
方法,并将以下内容添加到查询构建器中:
->whereNull('question_audio')
->whereNull('question_video')