修改充值

This commit is contained in:
liu 2024-06-06 16:12:42 +08:00
parent 5b27ec955f
commit f591acf7ca
3 changed files with 2 additions and 6 deletions

View File

@ -28,12 +28,8 @@ class PayController extends BaseApiController
{ {
$app = new PayService(1); $app = new PayService(1);
$result = $app->wechat->callback(Request()->post()); $result = $app->wechat->callback(Request()->post());
Cache::set('log'.time(),json_encode($result));
Cache::set('logE'.time(),$result->event_type);
Cache::set('logE1'.time(),$result['event_type']??'');
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') { if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
$ciphertext = $result->resource['ciphertext']; $ciphertext = $result->resource['ciphertext'];
Cache::set('logc'.time(),json_encode($result->resource['ciphertext'],true));
if ($ciphertext['trade_state'] === 'SUCCESS') { if ($ciphertext['trade_state'] === 'SUCCESS') {
$attach = $ciphertext['attach']; $attach = $ciphertext['attach'];
switch ($attach) { switch ($attach) {

View File

@ -65,7 +65,7 @@ class UserLogic extends BaseLogic
public static function info($uid) public static function info($uid)
{ {
$data = User::with(['userShip'])->where('id',$uid) $data = User::with(['userShip'])->where('id',$uid)
->field('avatar,real_name,nickname,account,mobile,sex,login_ip,user_money,total_recharge_amount,user_ship') ->field('avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship')
->find(); ->find();
//判断是不是员工 //判断是不是员工
if($data){ if($data){

View File

@ -130,7 +130,7 @@ class PayNotifyLogic extends BaseLogic
return true; return true;
} }
bcscale(2); bcscale(2);
$user->user_money = bcadd($user->user_money, $price, 2); $user->now_money = bcadd($user->now_money, $price, 2);
$user->total_recharge_amount = bcadd($user->total_recharge_amount, $price, 2); $user->total_recharge_amount = bcadd($user->total_recharge_amount, $price, 2);
$user->save(); $user->save();
//用户的财务add //用户的财务add