美好的一天。
这是我希望输出到我的刀片页面的插图。
>>> list = ['0','1','2','3','4','5','6']
>>> list.pop(0)
'0'
>>> list.pop(0)
'1'
>>> list.pop(0)
'2'
但是我不知道我应该在哪里调整,在我的 php 或我的 Mysql
在我的控制器中:
1. What was your dining experience?
Dine-in
Carry out
Delivery
2. How did you order?
Hotline
Online/Website
In-person
在我的Blade页面中:
public function getsurveyquestion()
{
$questionstitle = DB::select('SELECT q_type,q_title FROM survey_question');
$questions = DB::select('SELECT q_type,q_title,qcategory_question as category FROM survey_question as sq LEFT JOIN
(SELECT id,qid,qcategory_question FROM survey_category_question) scq ON sq.id = scq.qid');
return view('/survey')
->with('question',$questions)
->with('questiontitle',$questionstitle);
}
答案 0 :(得分:1)
在您的Blade页面中修改:
@foreach($questiontitle as $questions)
<b style="font-weight:300;"">{{$questions->q_title}}<br><br></b>
@foreach($question as $test)
@if($questions->q_title == $test->q_title) {{-- add condition here --}}
{{$test->category}}<br><br>
@endif
@endforeach
@endforeach