作者 郭文星

1231

... ... @@ -1857,16 +1857,7 @@ class Car extends Base
"commission_price"=>$rebook_fee,
];
$this->success("222请求成功", $data);
}else if($newrefund_time>3600 & $newrefund_time<7200){
$pay_fee = bcmul($order['price'],0.2,2);
$rebook_fee = $pay_fee;
}else if($newrefund_time>7200 & $newrefund_time<28800){
$pay_fee = bcmul($order['price'],0.1,2);
$rebook_fee = $pay_fee;
}else if($newrefund_time>28800 & $newrefund_time<43200){
$pay_fee = bcmul($order['price'],0.1,2);
$rebook_fee = $pay_fee;
}else if($newrefund_time>43200){
}else if( $newrefund_time<43200 & $newrefund_time>43200){
$pay_fee = $order['price'];
$rebook_fee = 0;
$res = Db::name("order")->where("id",$id)->update([
... ... @@ -1883,32 +1874,6 @@ class Car extends Base
$this->success("333请求成功", $data);
}
}
$res = Db::name("order")->where("id",$id)->update([
"commission_price"=>$rebook_fee,
"rebook"=>1,
"order_no" => getOrderSn(),
"reservation_time" => $reservation_time,
]);
$neworder=Db::name("order")->where("id", $id)->find();
$userinfo = Db::name('user')
->where(['id' => $this->auth->id])
->field('id,wx_xcx_openid')
->find();
$notifyURI = $this->doman . '/addons/epay/api/OrderPayNtf';
$params = [
'amount' => $neworder['commission_price'],
'orderid' => $neworder['order_no'],
'type' => 'wechat',
'notifyurl' => $notifyURI,
'method' => 'miniapp',
'openid' => $userinfo['wx_xcx_openid'],
];
$f = \addons\epay\library\Service::submitOrder($params);
$data=[
"pay"=>$f,
"commission_price"=>$neworder['commission_price'],
];
$this->success("123请求成功", $data);
} catch (UploadException $e) {
$this->error($e->getMessage());
}
... ...