Merge branch 'master' into dev

This commit is contained in:
zpc 2025-05-04 23:39:29 +08:00
commit 232bc8c06f
2 changed files with 16 additions and 3 deletions

6
.env
View File

@ -6,9 +6,9 @@ DEFAULT_TIMEZONE = Asia/Shanghai
[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = youda_test
USERNAME = youda_test
PASSWORD = youda_test
DATABASE = youda
USERNAME = youda
PASSWORD = youda
HOSTPORT = 3306
CHARSET = utf8
DEBUG = false

View File

@ -16,6 +16,7 @@ use app\common\model\OrderList;
use app\common\model\UserVip;
use app\common\model\UserCoupon;
use think\facade\Db;
use think\facade\Log;
use app\common\model\CouponReceive as CouponReceiveModel;
use app\common\model\GoodsExtend;
use \think\Request;
@ -685,6 +686,10 @@ class Infinite extends Base
'res' => $payRes['data']['res'],
];
} else {
#记录下单失败日志
Log::error('下单失败: 用户ID=' . $user['id'] . ', 订单号=' . $order_num . ', 商品ID=' . $goods_id . ', 返回信息=' . json_encode($payRes, JSON_UNESCAPED_UNICODE));
#删除redis
$redis->del($redis_key);
Db::rollback();
@ -709,6 +714,8 @@ class Infinite extends Base
Db::rollback();
#删除redis
$redis->del($redis_key);
#记录下单失败日志
Log::error('购买失败: 用户ID=' . $user['id'] . ', 订单号=' . $order_num . ', 商品ID=' . $goods_id . ', 提交结果=' . json_encode($res, JSON_UNESCAPED_UNICODE));
return $this->renderError("购买失败,请刷新重试");
}
}
@ -839,6 +846,8 @@ class Infinite extends Base
Db::rollback();
#删除redis
$redis->del($redis_key);
#记录下单失败日志
Log::error('秘宝池购买失败: 用户ID=' . $user['id'] . ', 订单号=' . $order_num . ', 商品ID=' . $goods_id . ', 提交结果=' . json_encode($res, JSON_UNESCAPED_UNICODE));
return $this->renderError("购买失败,请刷新重试");
}
}
@ -1137,6 +1146,8 @@ class Infinite extends Base
Db::rollback();
#删除redis
$redis->del($redis_key);
#记录下单失败日志
Log::error('抽奖券抽奖失败: 用户ID=' . $user['id'] . ', 订单号=' . $order_num . ', 商品ID=' . $goods_id . ', 提交结果=' . json_encode($res, JSON_UNESCAPED_UNICODE));
return $this->renderError("购买失败,请刷新重试");
}
}
@ -1253,6 +1264,8 @@ class Infinite extends Base
Db::rollback();
#删除redis
$redis->del($redis_key);
#记录重抽失败日志
Log::error('重抽卡重抽失败: 用户ID=' . $user['id'] . ', 订单号=' . $order_num . ', 商品ID=' . $goods_id . ', 订单列表ID=' . $order_list_ids . ', 提交结果=' . json_encode($res, JSON_UNESCAPED_UNICODE));
return $this->renderError("重抽失败,请刷新重试");
}