1.优化后台页面样式

2.优化统一订单中红利的状态和失败原因
3.移除项目中冗余代码和字段
This commit is contained in:
2026-04-21 11:59:15 +08:00
parent 1c900e7132
commit 3ac825f15d
26 changed files with 199 additions and 264 deletions

View File

@@ -198,6 +198,7 @@ class AngpowImportJobs
if ($code === '0' || $code === 0) {
MallOrder::whereIn('id', $orderIds)->update([
'grant_status' => MallOrder::GRANT_ACCEPTED,
'status' => MallOrder::STATUS_COMPLETED,
'fail_reason' => null,
'update_time' => time(),
]);
@@ -265,6 +266,21 @@ class AngpowImportJobs
];
}
/**
* 单条失败原因压成一行,避免异常信息自带换行导致与 attempt 分段混在一起。
*/
private function normalizeReasonLine(string $reason): string
{
$s = trim($reason);
if ($s === '') {
return '';
}
$s = str_replace(["\r\n", "\r", "\n"], ' ', $s);
$replaced = preg_replace('/\s+/', ' ', $s);
return is_string($replaced) && $replaced !== '' ? $replaced : $s;
}
private function markFailedAttempt(MallOrder $order, string $reason): void
{
// retry_count 在“准备发送”阶段已 +1此处用当前 retry_count 作为 attempt 编号
@@ -277,7 +293,7 @@ class AngpowImportJobs
$prev = $order->fail_reason;
$prefix = 'attempt ' . $attempt . ': ';
$line = $prefix . $reason;
$line = $prefix . $this->normalizeReasonLine($reason);
$newReason = $line;
if (is_string($prev) && $prev !== '') {
$newReason = $prev . "\n" . $line;

View File

@@ -171,7 +171,8 @@ class PlayxJobs
$result = MallBonusGrantPush::push($order);
if ($result['ok']) {
$order->grant_status = MallOrder::GRANT_ACCEPTED;
$order->playx_transaction_id = $result['playx_transaction_id'];
$order->status = MallOrder::STATUS_COMPLETED;
$order->update_time = time();
$order->save();
return;