This commit is contained in:
mkm 2024-07-06 17:32:56 +08:00
commit 1ee0e2b7c2
3 changed files with 5 additions and 1 deletions

View File

@ -34,6 +34,7 @@ class PayController extends BaseApiController
$attach = $ciphertext['attach']; $attach = $ciphertext['attach'];
switch ($attach) { switch ($attach) {
case 'recharge': case 'recharge':
Cache::set('6logR' . time(), json_encode($ciphertext));
PayNotifyLogic::handle('recharge', $ciphertext['out_trade_no'], $ciphertext); PayNotifyLogic::handle('recharge', $ciphertext['out_trade_no'], $ciphertext);
$app->wechat->success(); $app->wechat->success();
break; break;

View File

@ -137,6 +137,7 @@ class StoreController extends BaseApiController
return $this->fail(PaymentLogic::getError()); return $this->fail(PaymentLogic::getError());
} }
if (isset($result['trade_state_desc']) && $result['trade_state_desc'] == '支付成功') { if (isset($result['trade_state_desc']) && $result['trade_state_desc'] == '支付成功') {
Cache::set('trade_state' . time(), json_encode($result));
PayNotifyLogic::handle('recharge', $result['out_trade_no'], $result); PayNotifyLogic::handle('recharge', $result['out_trade_no'], $result);
} else { } else {
Redis::send('send-code-pay', ['order_id' => $order['order_id'],'pay_type'=>'recharge']); Redis::send('send-code-pay', ['order_id' => $order['order_id'],'pay_type'=>'recharge']);

View File

@ -3,11 +3,13 @@
namespace app\common\logic; namespace app\common\logic;
use app\common\enum\YesNoEnum;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\model\user\User; use app\common\model\user\User;
use app\common\model\user_recharge\UserRecharge; use app\common\model\user_recharge\UserRecharge;
use app\common\model\user_sign\UserSign; use app\common\model\user_sign\UserSign;
use app\common\model\user_sign_log\UserSignLog; use app\common\model\user_sign_log\UserSignLog;
use function Symfony\Component\String\s;
/** /**
* 会员积分逻辑 * 会员积分逻辑
@ -42,7 +44,7 @@ class UserSignLogic extends BaseLogic
if($total_vip==0){ if($total_vip==0){
return false; return false;
} }
$count = UserRecharge::where('uid', $order->uid)->count(); $count = UserRecharge::where(['uid'=>$order->uid,'paid'=>YesNoEnum::YES])->count();
if ($count ==1 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { if ($count ==1 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) {
//首充 //首充
$write = self::write($order, $total_vip, 0, 1, 9); $write = self::write($order, $total_vip, 0, 1, 9);