diff --git a/webht/third_party/trippestOrderSync/controllers/api.php b/webht/third_party/trippestOrderSync/controllers/api.php index d284dcda..9357c565 100644 --- a/webht/third_party/trippestOrderSync/controllers/api.php +++ b/webht/third_party/trippestOrderSync/controllers/api.php @@ -191,7 +191,11 @@ class Api extends CI_Controller { $ret['operation'][$value->GCOD_startDate]['cardriver'][] = $tmp_car; // 出团时间 $ret['operation'][$value->GCOD_startDate]['start_date'] = $value->GCOD_startDate; - $ret['operation'][$value->GCOD_startDate]['end_date'] = $value->GCOD_endDate; + if ( ! $ret['operation'][$value->GCOD_startDate]['end_date'] + || strtotime($ret['operation'][$value->GCOD_startDate]['end_date']) > strtotime($value->GCOD_endDate) + ) { + $ret['operation'][$value->GCOD_startDate]['end_date'] = $value->GCOD_endDate; + } } else if ($value->GCOD_operationType === 'guiderOperations') { $tmp_g = array(); @@ -204,7 +208,11 @@ class Api extends CI_Controller { $ret['operation'][$value->GCOD_startDate]['tourguide'][] = $tmp_g; // 出团时间 $ret['operation'][$value->GCOD_startDate]['start_date'] = $value->GCOD_startDate; - $ret['operation'][$value->GCOD_startDate]['end_date'] = $value->GCOD_endDate; + if ( ! $ret['operation'][$value->GCOD_startDate]['end_date'] + || strtotime($ret['operation'][$value->GCOD_startDate]['end_date']) > strtotime($value->GCOD_endDate) + ) { + $ret['operation'][$value->GCOD_startDate]['end_date']= $value->GCOD_endDate; + } } } // 加上行程