Пример #1
0
 public function grades()
 {
     $res = Record::select('grade')->distinct()->get()->toArray();
     $grades = array();
     foreach ($res as $v) {
         $grades[] = $v['grade'];
     }
     return response()->json($grades);
 }
Пример #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $count = 20;
     //访问一次,更新20条记录
     $res = Record::select('id', 'phone')->whereNull('phone_province')->whereNotNull('phone')->limit($count)->get();
     $res = $res->toArray();
     $ko = 2;
     foreach ($res as $v) {
         $mobile = $v['phone'];
         if ($mobile) {
             if ($ko == 1) {
                 $data = $this->taobao($mobile);
             } else {
                 $data = $this->tenpay($mobile);
             }
             if ($data) {
                 Record::where('id', $v['id'])->update(['phone_province' => $data['province'], 'phone_city' => $data['city'], 'phone_supplier' => $data['supplier']]);
             }
         }
     }
     exit;
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $records = Record::select('*')->where('patient_id', '=', $id)->get();
     $patient = Patient::findOrFail($id);
     return view('pages.patient.patientdetails', compact('patient', 'records'));
 }