post(); $this->validate(request(), [ 'service_type' => 'required|integer', ]); $user = $this->user; $doctor_id = $user['id']; $where['docter_id'] = $doctor_id; $where['service_type'] = $req['service_type']; $data = ServiceApply::where($where)->first(); if(empty($data)){ ServiceApply::create([ 'docter_id' => $doctor_id, 'service_type' => $req['service_type'], 'status' => 1 //审核状态 1 审核 2 已通过 3 已拒绝 ]); return out(); }else{ return out('','','您已提交'); } } }