diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index 2a0ea7cf8..1aa380e9c 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -34,6 +34,7 @@ class PayController extends BaseApiController $attach = $ciphertext['attach']; switch ($attach) { case 'recharge': + Cache::set('6logR' . time(), json_encode($ciphertext)); PayNotifyLogic::handle('recharge', $ciphertext['out_trade_no'], $ciphertext); $app->wechat->success(); break; diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index 2e26b80a5..3b5fde4c5 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -137,6 +137,7 @@ class StoreController extends BaseApiController return $this->fail(PaymentLogic::getError()); } 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); } else { Redis::send('send-code-pay', ['order_id' => $order['order_id'],'pay_type'=>'recharge']); diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index 7f77e4f40..0ee943a74 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -3,11 +3,13 @@ namespace app\common\logic; +use app\common\enum\YesNoEnum; use app\common\logic\BaseLogic; use app\common\model\user\User; use app\common\model\user_recharge\UserRecharge; use app\common\model\user_sign\UserSign; 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){ 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])) { //首充 $write = self::write($order, $total_vip, 0, 1, 9);