|
|
@@ -175,7 +175,6 @@ class StoreOrderController
|
|
|
return app('json')->fail('砍价已支付');
|
|
|
StoreBargainUser::setBargainUserStatus($bargainId, $uid); //修改砍价状态
|
|
|
}
|
|
|
- @file_put_contents('quanju2.txt', "-咋回事啊\r\n", 8);
|
|
|
if ($pinkId) {
|
|
|
if (StorePink::getIsPinkUid($pinkId, $request->uid()))
|
|
|
return app('json')->status('ORDER_EXIST', '订单生成失败,你已经在该团内不能再参加了', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $request->uid())]);
|
|
|
@@ -196,7 +195,6 @@ class StoreOrderController
|
|
|
if ($orderId) {
|
|
|
event('OrderCreated', [$order]); //订单创建成功事件
|
|
|
event('ShortMssageSend', [$orderId, 'AdminPlaceAnOrder']);//发送管理员通知
|
|
|
- @file_put_contents('quanju2.txt', $payType."-支付方式\r\n", 8);
|
|
|
switch ($payType) {
|
|
|
case "weixin":
|
|
|
$orderInfo = StoreOrder::where('order_id', $orderId)->find();
|
|
|
@@ -204,20 +202,15 @@ class StoreOrderController
|
|
|
$orderInfo = $orderInfo->toArray();
|
|
|
if ($orderInfo['paid']) return app('json')->fail('支付已支付!');
|
|
|
//支付金额为0
|
|
|
- @file_put_contents('quanju2.txt', "-到这里了吗\r\n", 8);
|
|
|
if (bcsub((float)$orderInfo['pay_price'], 0, 2) <= 0) {
|
|
|
//创建订单jspay支付
|
|
|
$payPriceStatus = StoreOrder::jsPayPrice($orderId, $uid, $formId);
|
|
|
- if ($payPriceStatus){//0元支付成功
|
|
|
+ if ($payPriceStatus)//0元支付成功
|
|
|
return app('json')->status('success', '微信支付成功', $info);
|
|
|
- } else{
|
|
|
-
|
|
|
+ else
|
|
|
return app('json')->status('pay_error', StoreOrder::getErrorInfo());
|
|
|
- }
|
|
|
-
|
|
|
} else {
|
|
|
try {
|
|
|
- @file_put_contents('quanju2.txt', $from."-微信支付方式\r\n", 8);
|
|
|
if ($from == 'routine') {
|
|
|
$jsConfig = OrderRepository::jsPay($orderId); //创建订单jspay
|
|
|
} else if ($from == 'weixinh5') {
|
|
|
@@ -225,9 +218,7 @@ class StoreOrderController
|
|
|
} else {
|
|
|
$jsConfig = OrderRepository::wxPay($orderId);
|
|
|
}
|
|
|
- @file_put_contents('quanju2.txt', $jsConfig."-微信支付失败2\r\n", 8);
|
|
|
} catch (\Exception $e) {
|
|
|
- @file_put_contents('quanju2.txt', $e->getMessage()."-微信支付失败\r\n", 8);
|
|
|
return app('json')->status('pay_error', $e->getMessage(), $info);
|
|
|
}
|
|
|
$info['jsConfig'] = $jsConfig;
|