PR

ユーザー残高日次スナップショット移行スクリプト #4519

wada opened this at 2026-02-16T16:41:46; closed

Description

opened by wada at 2026-02-16T16:41:46; updated 2026-02-16T17:12:32

概要

管理画面用のデータ準備

デイリーのユーザーのコイン所持量の保存	

・YG
user_no・有償コイン・割合・無償コイン
定点観測ができれば

・GT
user_no・有償コイン
できればメディアID毎

cron


0 3 * * * ENVIRONMENT=${JR_ENV} PF=yamada
${JR_DIR}/lib/exec/cpanel_user_platform_balance_daily.sh

テーブル

CREATE TABLE `cpanel_user_platform_balance_daily` (
  `date` date NOT NULL COMMENT '集計対象日',
  `user_no` int(11) unsigned NOT NULL,
  `balance` int(11) unsigned NOT NULL DEFAULT '0',
  `coin` int(11) unsigned NOT NULL DEFAULT '0',
  `free_coin` int(11) unsigned NOT NULL DEFAULT '0',
  `update_date` datetime NOT NULL COMMENT '元テーブルの更新日時',
  `reg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'このログの記録日時',
  PRIMARY KEY (`date`,`user_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ユーザー残高の日次スナップショット';
wada merge at 2026-02-16T17:06:01: ユーザー残高日次スナップショット移行スクリプト
wada close at 2026-02-16T17:06:01: Close
wada delete_branch at 2026-02-16T17:06:05: user_platform_balance

Commit range

base002050cc727b3935d7e70d41ae6c6863fe89d2af
head70752b8fb8ce0bca0317a6c5159233b3501422df
base branchjolly/jr-web:master
head branchjolly/jr-web:user_platform_balance

View commits

Commit details are loaded from Git when a dynamic archive server is running, or can be embedded with --include-commits.
Files changed2 filesView patch
statusfile
addedlib/exec/cpanel_user_platform_balance_daily.php
addedlib/exec/cpanel_user_platform_balance_daily.sh
Patch body is stored as a separate file to keep this page lightweight.