|
@@ -0,0 +1,55 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+namespace App\Http\Controllers;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+use App\Models\OrderPatient;
|
|
|
|
+use App\Models\Patient;
|
|
|
|
+use App\Models\User;
|
|
|
|
+
|
|
|
|
+class AppiontController extends Controller
|
|
|
|
+{
|
|
|
|
+ public function getAppiontInfo()
|
|
|
|
+ {
|
|
|
|
+ $data = request()->all();
|
|
|
|
+ $defaulRes = [
|
|
|
|
+ 'server_handle_result'=>0,
|
|
|
|
+ 'reserve_check_result'=>0,
|
|
|
|
+ 'allow_get_ticket'=>0,
|
|
|
|
+ 'allow_get_ticket'=>0,
|
|
|
|
+ 'tip_msg'=>'',
|
|
|
|
+ 'reserve_service_no'=>0,
|
|
|
|
+ 'reserve_date'=>'',
|
|
|
|
+ 'reserve_start_time'=>'',
|
|
|
|
+ 'reserve_end_time'=>'',
|
|
|
|
+ 'allow_post_ticket'=>0,
|
|
|
|
+ ];
|
|
|
|
+ if(empty($data['telphone'])){
|
|
|
|
+ $defaulRes['tip_msg'] = '请输入手机号';
|
|
|
|
+ exit(json_encode($defaulRes));
|
|
|
|
+ }
|
|
|
|
+ if(empty($data['sig'])){
|
|
|
|
+ $defaulRes['tip_msg'] = '请输入sig签名';
|
|
|
|
+ exit(json_encode($defaulRes));
|
|
|
|
+ }
|
|
|
|
+ if(empty($data['SecretKey']) || $data['SecretKey'] != 2018){
|
|
|
|
+ $defaulRes['tip_msg'] = 'SecretKey秘钥错误';
|
|
|
|
+ exit(json_encode($defaulRes));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(empty($data['st']) ){
|
|
|
|
+ $defaulRes['tip_msg'] = '请输入时间信息';
|
|
|
|
+ exit(json_encode($defaulRes));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $sign = mdt($data['id'].$data['telphone'].$data['barcode'].$data['st'].$data['st'].$data['area'].$data['st'].$data['st'].$data['SecretKey']);
|
|
|
|
+ if($data['sig'] != $sign){
|
|
|
|
+ $defaulRes['sig'] = '签名验证失败';
|
|
|
|
+ exit(json_encode($defaulRes));
|
|
|
|
+ }
|
|
|
|
+ $user_id = User::where('phone',$data['phone'])->user_id;
|
|
|
|
+ $patient_id = Patient::where('user_id',$user_id)->pluck('id')->toArray();
|
|
|
|
+ $order_list = OrderPatient::whereIn('patient_id',$patient_id)->where('patient_id',$patient_id)->where('appiont_start_time',$data['st'])->get();
|
|
|
|
+ }
|
|
|
|
+}
|