|
|
@@ -193,10 +193,17 @@ class PurchaseController extends BaseController
|
|
|
util::fail('订单号无效');
|
|
|
}
|
|
|
$id = $order->id;
|
|
|
+ $order->changePrice = 2;
|
|
|
+ $order->save();
|
|
|
+
|
|
|
+ $deadline = $order->deadline;
|
|
|
+ $current = date("Y-m-d H:i:s");
|
|
|
+ if ((strtotime($deadline) + 20) < strtotime($current)) {
|
|
|
+ util::fail('订单已经失效');
|
|
|
+ }
|
|
|
|
|
|
$name = $orderSn;
|
|
|
$totalFee = $order->realPrice;
|
|
|
-
|
|
|
//强制使用小程序的miniOpenId
|
|
|
$openId = isset($this->admin) && !empty($this->admin) ? $this->admin->miniOpenId : '';
|
|
|
if (empty($openId)) {
|
|
|
@@ -238,14 +245,10 @@ class PurchaseController extends BaseController
|
|
|
|
|
|
//强制使用小程序的miniAppId
|
|
|
$merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
|
|
|
-
|
|
|
$wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
|
|
|
$tools = new \JsApiPay();
|
|
|
$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
|
|
|
$newParams = json_decode($jsApiParameters, true);
|
|
|
- $current = date("Y-m-d H:i:s");
|
|
|
- $updateData = ['deadline' => $current, 'changePrice' => 2];
|
|
|
- PurchaseClass::updateById($id, $updateData);
|
|
|
$newParams['id'] = $id;
|
|
|
util::success($newParams);
|
|
|
}
|