红包第一次修改

This commit is contained in:
2025-10-11 14:54:43 +08:00
parent 204c19ff6d
commit 641368f78e

View File

@@ -45,7 +45,7 @@ class Redpacket extends Model
public function createRedpacket($data)
{
Db::startTrans();
// try {
try {
// 验证用户余额
$wallet = Db::name('user_wallet')->where('user_id', $data['user_id'])->find();
@@ -121,11 +121,11 @@ class Redpacket extends Model
// return $redpacketId;
return V(1, '发红包成功', $redpacketId);
// } catch (\Exception $e) {
// Db::rollback();
// return V(0, $e);
//// throw $e;
// }
} catch (\Exception $e) {
Db::rollback();
return V(0, $e);
// throw $e;
}
}
/**