|
@@ -15,7 +15,6 @@ class AppiontController extends Controller
|
|
public function getAppiontInfo()
|
|
public function getAppiontInfo()
|
|
{
|
|
{
|
|
$data = request()->all();
|
|
$data = request()->all();
|
|
-// dd(strtotime('2021-01-20 09:31:00'));
|
|
|
|
$defaulRes = [
|
|
$defaulRes = [
|
|
'server_handle_result'=>0,
|
|
'server_handle_result'=>0,
|
|
'reserve_check_result'=>0,
|
|
'reserve_check_result'=>0,
|
|
@@ -46,8 +45,6 @@ class AppiontController extends Controller
|
|
$defaulRes['tip_msg'] = '请输入手机号';
|
|
$defaulRes['tip_msg'] = '请输入手机号';
|
|
exit(json_encode($defaulRes));
|
|
exit(json_encode($defaulRes));
|
|
}
|
|
}
|
|
-// $sign = md5($data['id'].$data['telphone'].$data['barcode'].$data['st'].$data['st'].$data['area'].$data['st'].$data['st'].$data['SecretKey']);
|
|
|
|
-//dd($sign);
|
|
|
|
if(empty($data['sig'])){
|
|
if(empty($data['sig'])){
|
|
$defaulRes['tip_msg'] = '请输入sig签名';
|
|
$defaulRes['tip_msg'] = '请输入sig签名';
|
|
exit(json_encode($defaulRes));
|
|
exit(json_encode($defaulRes));
|
|
@@ -75,7 +72,7 @@ class AppiontController extends Controller
|
|
}
|
|
}
|
|
|
|
|
|
if(empty($user_id)){
|
|
if(empty($user_id)){
|
|
- $defaulRes['sig'] = '无效账号';
|
|
|
|
|
|
+ $defaulRes['tip_msg'] = '无效账号';
|
|
exit(json_encode($defaulRes));
|
|
exit(json_encode($defaulRes));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,7 +86,6 @@ class AppiontController extends Controller
|
|
});
|
|
});
|
|
}
|
|
}
|
|
$order_list =$order->first();
|
|
$order_list =$order->first();
|
|
- dump(DB::getQueryLog());
|
|
|
|
if(empty($order_list)){
|
|
if(empty($order_list)){
|
|
$defaulRes['tip_msg'] = '无预约';
|
|
$defaulRes['tip_msg'] = '无预约';
|
|
exit(json_encode($defaulRes));
|
|
exit(json_encode($defaulRes));
|
|
@@ -99,37 +95,25 @@ class AppiontController extends Controller
|
|
$defaulRes['orderId'] = $order['id'];
|
|
$defaulRes['orderId'] = $order['id'];
|
|
$defaulRes['server_handle_result'] = 1;
|
|
$defaulRes['server_handle_result'] = 1;
|
|
if( $order['is_ticket'] == 0 && !empty($order['order_patient'])){
|
|
if( $order['is_ticket'] == 0 && !empty($order['order_patient'])){
|
|
- if(intval($order['order_patient']['appoint_start_time']) < intval($data['st']) || intval($data['st']) < time()){
|
|
|
|
- $defaulRes['sig'] = '预约已过期,您预约的时间为:'.date('Y-m-d',strtotime($order['order_patient']['appoint_start_time'])).date('H:i',$order['order_patient']['appoint_start_time']).'~'.date('H:i',$order['order_patient']['appoint_end_time']);
|
|
|
|
|
|
+ $start = intval($order['order_patient']['appoint_start_time']);
|
|
|
|
+ $end = intval($order['order_patient']['appoint_end_time']);
|
|
|
|
+ $date = date('Y-m-d',intval($order['order_patient']['appoint_start_time']));
|
|
|
|
+
|
|
|
|
+ if($end < intval($data['st']) || intval($data['st']) < time()){
|
|
|
|
+ $defaulRes['tip_msg'] = '预约已过期,您预约的时间为:'.$date.' '.date('H:i',$start).'~'.date('H:i',$end);
|
|
exit(json_encode($defaulRes));
|
|
exit(json_encode($defaulRes));
|
|
}
|
|
}
|
|
- $defaulRes['reserve_start_time'] = date('H:i',intval($order['order_patient']['appoint_start_time']));
|
|
|
|
- $defaulRes['reserve_end_time'] = date('H:i',intval($order['order_patient']['appoint_end_time']));
|
|
|
|
|
|
+ $defaulRes['reserve_start_time'] = date('H:i',$start);
|
|
|
|
+ $defaulRes['reserve_end_time'] = date('H:i',$end);
|
|
$defaulRes['allow_post_ticket'] = 1;
|
|
$defaulRes['allow_post_ticket'] = 1;
|
|
|
|
+ $defaulRes['allow_get_ticket'] = 1;
|
|
$defaulRes['reserve_check_result'] = 1;
|
|
$defaulRes['reserve_check_result'] = 1;
|
|
- $defaulRes['reserve_date'] = date('Y-m-d',strtotime(intval($order['order_patient']['appoint_start_time'])));
|
|
|
|
|
|
+ $defaulRes['reserve_date'] = $date;
|
|
} else {
|
|
} else {
|
|
$defaulRes['reserve_check_result'] = 1;
|
|
$defaulRes['reserve_check_result'] = 1;
|
|
$defaulRes['allow_post_ticket'] = 0;
|
|
$defaulRes['allow_post_ticket'] = 0;
|
|
}
|
|
}
|
|
|
|
|
|
-// foreach ($order_list as $order){
|
|
|
|
-// $defauldata = $defaulRes;
|
|
|
|
-// $defauldata['orderId'] = $order['id'];
|
|
|
|
-// if(!$order['is_ticket'] && !empty($order['orderPatient'])){
|
|
|
|
-// $defauldata['reserve_start_time'] = $order['orderPatient']['appoint_start_time'];
|
|
|
|
-// $defauldata['reserve_end_time'] = $order['orderPatient']['appoint_end_time'];
|
|
|
|
-// $defauldata['allow_post_ticket'] = 1;
|
|
|
|
-// $defauldata['reserve_check_result'] = 1;
|
|
|
|
-// $defauldata['reserve_date'] = date('Y-m-d',strtotime($order['orderPatient']['appoint_start_time']));
|
|
|
|
-// } else {
|
|
|
|
-// $defauldata['reserve_check_result'] = 1;
|
|
|
|
-// $defauldata['allow_post_ticket'] = 0;
|
|
|
|
-// }
|
|
|
|
-// $appiontList [] = $defauldata;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
exit(json_encode($defaulRes));
|
|
exit(json_encode($defaulRes));
|
|
}
|
|
}
|
|
|
|
|