feat: 修改支付控制器及逻辑,优化支付成功后的处理流程,并调整会员充值计算方式。
This commit is contained in:
parent
f9114271ec
commit
9082a73f80
@ -38,10 +38,13 @@ class PayController extends BaseApiController
|
|||||||
$app->wechat->success();
|
$app->wechat->success();
|
||||||
break;
|
break;
|
||||||
case 'wechat_common':
|
case 'wechat_common':
|
||||||
default:
|
|
||||||
PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext);
|
PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext);
|
||||||
$app->wechat->success();
|
$app->wechat->success();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res);
|
||||||
|
$app->wechat->success();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -76,7 +79,7 @@ class PayController extends BaseApiController
|
|||||||
try {
|
try {
|
||||||
$res = $app->wechat->query($order);
|
$res = $app->wechat->query($order);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->fail($e->extra['message']);
|
return $this->fail($e->extra['message'] ?? $e->getMessage());
|
||||||
}
|
}
|
||||||
if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') {
|
if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') {
|
||||||
$attach = $res['attach'];
|
$attach = $res['attach'];
|
||||||
@ -86,6 +89,9 @@ class PayController extends BaseApiController
|
|||||||
$app->wechat->success();
|
$app->wechat->success();
|
||||||
break;
|
break;
|
||||||
case 'wechat_common':
|
case 'wechat_common':
|
||||||
|
PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res);
|
||||||
|
$app->wechat->success();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res);
|
PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res);
|
||||||
$app->wechat->success();
|
$app->wechat->success();
|
||||||
|
@ -22,17 +22,17 @@ class UserSignLogic extends BaseLogic
|
|||||||
public static function dealRechargeFrozen($user, $order, $user_ship = 0)
|
public static function dealRechargeFrozen($user, $order, $user_ship = 0)
|
||||||
{
|
{
|
||||||
switch ($order['price']) {
|
switch ($order['price']) {
|
||||||
case $order['price'] >= 1000 && $order['price'] < 2000:
|
case 1000:
|
||||||
$total_vip = bcmul($order['price'], 0.25, 2);
|
$total_vip = 249;
|
||||||
break;
|
break;
|
||||||
case $order['price'] >= 2000 && $order['price'] < 5000:
|
case 2000:
|
||||||
$total_vip = bcmul($order['price'], 0.28, 2);
|
$total_vip = 560;
|
||||||
break;
|
break;
|
||||||
case $order['price'] >= 5000 && $order['price'] < 10000:
|
case 5000:
|
||||||
$total_vip = bcmul($order['price'], 0.31, 2);
|
$total_vip = 1550;
|
||||||
break;
|
break;
|
||||||
case $order['price'] >= 10000:
|
case 10000:
|
||||||
$total_vip = bcmul($order['price'], 0.35, 2);
|
$total_vip = 3500;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$total_vip = 0;
|
$total_vip = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user