field('article_record_id,article_question_id,answer as user_answer') ->where('article_record_id',$recordId) ->select(); foreach ($ret as $k=>$val){ $question=Db::name('article_question') ->field('article_paper_id,options,score,title,type') ->where('id',$val['article_question_id']) ->find(); $ret[$k]['article_paper_id']=$question?$question['article_paper_id']:''; $ret[$k]['options']=$question?$question['options']:''; $ret[$k]['score']=$question?$question['score']:''; $ret[$k]['title']=$question?$question['title']:''; $ret[$k]['type']=$question?$question['type']:''; } if($ret){ HelpHander::success($ret); }else{ HelpHander::error('暂无数据'); } } }