|
@@ -334,7 +334,7 @@ class Taxi extends ApiController
|
|
|
$valid = $this->validate($param, [
|
|
$valid = $this->validate($param, [
|
|
|
'id' => 'require|number',
|
|
'id' => 'require|number',
|
|
|
]);
|
|
]);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 错误
|
|
// 错误
|
|
|
if (true !== $valid) {
|
|
if (true !== $valid) {
|
|
|
return $this->ApiJson(-1, $valid);
|
|
return $this->ApiJson(-1, $valid);
|
|
@@ -357,9 +357,14 @@ class Taxi extends ApiController
|
|
|
// 如果平台已指派司机,则扣除部分金额
|
|
// 如果平台已指派司机,则扣除部分金额
|
|
|
$cost_price = 0;
|
|
$cost_price = 0;
|
|
|
$taxiUid = isset($row['taxi_uid'])? $row['taxi_uid'] : 0;
|
|
$taxiUid = isset($row['taxi_uid'])? $row['taxi_uid'] : 0;
|
|
|
- if ($row['status'] == 3) {
|
|
|
|
|
- $total_price = $total_price * (1 - $config['store']['store_cancel_order']/100);
|
|
|
|
|
- $cost_price = $total_price * $config['store']['store_cancel_order']/100;
|
|
|
|
|
|
|
+ $createTime = isset($row['created_at'])? $row['created_at'] : 0;
|
|
|
|
|
+ $cancelTime = isset($config['store']['store_cancel_order'])? $config['store']['store_cancel_order'] : 0;
|
|
|
|
|
+ if ($row['status'] == 3 ) {
|
|
|
|
|
+ // 免费取消时间内不扣除
|
|
|
|
|
+ if($cancelTime<=0 || time() < ($createTime - $cancelTime)){
|
|
|
|
|
+ $total_price = $total_price * (1 - $config['store']['store_cancel_order']/100);
|
|
|
|
|
+ $cost_price = $total_price * $config['store']['store_cancel_order']/100;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if ($row->paylog['pay_type'] == 'balance') {
|
|
if ($row->paylog['pay_type'] == 'balance') {
|
|
|
model('common/Users')->changeBalance(
|
|
model('common/Users')->changeBalance(
|