芝麻web文件管理V1.00
编辑当前文件:/home/rejoandoctor/www/app/Http/Controllers/Prescribe/MpoController.php
middleware('auth'); } public function index() { return view('Prescribe.mpo.dashboard'); } function mpo_doctor_list() { $doctor = DB::table('permission') ->where('mpo_id', Auth::user()->customer_id) ->where('status', 1) ->join('customers', 'permission.doctor_id', 'customers.id') ->select('permission.*', 'customers.customer_name', 'customers.id', 'customers.image') ->get(); return view('Prescribe.mpo.doctor_list', compact('doctor')); } function pres_by_doctor(Request $request, $id) { // if (isset($request->start) && isset($request->end)) { // $start = $request->start; // $end = $request->end; // }else{ // $start = Carbon::now()->month(); // $end = Carbon::now(); // } $prescription = Prescription::select('id','patient_name', 'doctor_id', 'patient_mobile', 'patient_sex', 'visit_date', 'prescribe_status', 'patient_type') ->where('doctor_id', $id) ->where('prescribe_status',1) // ->whereBetween('visit_date', array($start, $end)) ->whereDate('visit_date', Carbon::today()) ->orderByDesc('visit_date')->get(); //dd($prescription); return view('Prescribe.mpo.prescription_by_doctor', compact('prescription')); } function mpo_preview_prescroption($patient_id, $doctor_id) { $patient = Prescription::where('id', $patient_id)->first(); $signature = Signature::where('doctor_id', $doctor_id)->first(); $doctor = Ph_header::where('doctor_id', $doctor_id)->first(); $customizeprescription = CustomizePrescription::where('doctor_id', $doctor_id)->first(); return view('Prescribe.doctor.prescription_pad_default', compact('patient','doctor', 'signature', 'customizeprescription')); } function insert_request(Request $request) { $data = $request->doctor_id; $doctor = Permission::where('mpo_id', Auth::user()->customer_id)->where('doctor_id', $data)->first(); //dd($doctor); if(isset($doctor)) { Session::flash('success', 'Already Requested!!! Please Contact with Doctor'); return redirect()->back(); }else{ $data = Permission::insert([ 'mpo_id' => $request->mpo_id, 'doctor_id' => $request->doctor_id, ]); Session::flash('success', 'Request Sent, Please contact with doctor for approval!!!'); return redirect()->back(); } } }