查询方式,只查某些字段用get,只查第一条用first
$from_detail = VenousThrombusAnswer::where('venous_thrombosis_risk_assessment_token', $venousThrombosisRiskAssessmentToken) ->orderBy('id','desc') ->first(['id','total','grade']); $question_id = VenousThrombusForms::where('question', $venousFormsModel->question) ->first(['id']) ->toArray();
添加方式:用save方法
$this->form_id = 0; $this->grade = 1; $this->total = 1; $this->save();
获取此次后插入的id
$id = $this->id;
获取此次插入后的total
$total = $this->total;