优化每日推送和积分转化多语言样式

This commit is contained in:
2026-07-24 12:01:41 +08:00
parent 4bad91b8a3
commit e3d4ec4624
15 changed files with 204 additions and 65 deletions

View File

@@ -144,9 +144,17 @@ class PlayxConfig extends Backend
} catch (\Throwable $e) {
Db::rollback();
return $this->error($e->getMessage());
return $this->error(__($e->getMessage()));
}
return $this->success(__('Operation completed'), $stats);
return $this->success(
sprintf(
__('Lifetime points calculation completed'),
$stats['processed'],
$stats['updated'],
$stats['skipped']
),
$stats
);
}
}

View File

@@ -28,6 +28,8 @@ return [
'Deleted successfully' => 'Deleted successfully!',
'Parameter error' => 'Parameter error!',
'Lifetime points source is disabled' => 'Lifetime points source is disabled',
'Operation completed' => 'Operation completed!',
'Lifetime points calculation completed' => 'Lifetime conversion done: %d processed, %d updated, %d skipped',
'File uploaded successfully' => 'File uploaded successfully',
'No files were uploaded' => 'No files were uploaded',
'The uploaded file format is not allowed' => 'The uploaded file format is no allowance.',

View File

@@ -28,6 +28,8 @@ return [
'Deleted successfully' => '删除成功!',
'Parameter error' => '参数错误!',
'Lifetime points source is disabled' => '终身总输赢积分来源未启用',
'Operation completed' => '操作完成!',
'Lifetime points calculation completed' => '终身总输赢积分折算完成:共处理 %d 条,更新 %d 条,跳过 %d 条',
'Please use the %s field to sort before operating' => '请使用 %s 字段排序后再操作',
'File uploaded successfully' => '文件上传成功!',
'No files were uploaded' => '没有文件被上传',

View File

@@ -142,13 +142,13 @@ final class MallPointsConversion
public static function recalculateAllLifetimePoints(MallBusinessConfig $row): array
{
if (intval($row->lifetime_points_enabled ?? 0) !== 1) {
throw new \RuntimeException(__('Lifetime points source is disabled'));
throw new \RuntimeException('Lifetime points source is disabled');
}
$config = self::configFromRow($row);
$ratio = floatval($config['lifetime_points_ratio'] ?? 0);
if ($ratio < 0) {
throw new \RuntimeException(__('Parameter error'));
throw new \RuntimeException('Parameter error');
}
$stats = ['processed' => 0, 'updated' => 0, 'skipped' => 0];