嗨,有没有人可以帮助我,是否可以只接受不包含音频或视频的问题,而忽略那些包含音频或视频的问题:
这是我的控制器,我的控制器的一部分:
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,这是我的结果,当我转储时,我有两个问题,一个有音频,另一个没有音频,我希望能够忽略有音频的问题,而不是带音频的问题。我怎么才能放一条消息,并说音频和视频不包括和不包括它们?


发布于 2018-06-22 18:00:14
修改您的questionwithanswers方法并将以下内容添加到查询构建器中:
->whereNull('question_audio')
->whereNull('question_video')https://stackoverflow.com/questions/50985267
复制相似问题