Description
jolly/jr-rzst#23
集金レポート実装準備
以下のバッチを実行してデータを用意
#集金額集計プログラム(cron設定)
daily_user_collect_gold.inc
#全プレイヤー対象に日毎の集金額を取得する
tool_get_all_player_collect.inc
#全プレイヤー対象に過去最高の集金額を取得する
tool_get_all_player_best_gold_collect.incテーブル追加
#毎日の集金額
CREATE TABLE `daily_user_collect_gold` (
`user_no` bigint(20) NOT NULL,
`date` date NOT NULL,
`gold` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `daily_user_collect_gold`
ADD PRIMARY KEY (`user_no`,`date`),
ADD KEY `date` (`date`);
#秘書コメント
CREATE TABLE `master_gold_collect_report_secretary` (
`secretary_id` int(11) NOT NULL,
`gold` int(11) NOT NULL,
`message_1` char(255) COLLATE utf8_unicode_ci NOT NULL,
`message_2` char(255) COLLATE utf8_unicode_ci NOT NULL,
`start_time` datetime NOT NULL,
`end_time` datetime NOT NULL,
`limited_flg` tinyint(4) NOT NULL COMMENT '限定フラグ',
`del_flg` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `master_gold_collect_report_secretary` (`secretary_id`, `gold`, `message_1`, `message_2`, `start_time`, `end_time`, `limited_flg`, `del_flg`) VALUES
(1, 500000, 'この調子で頑張りましょう。', '全て集金し終えました。<br>次の集金時間は<br>【{time}】です。', '2021-03-08 00:00:00', '2037-01-01 00:00:00', 0, 0);
ALTER TABLE `master_gold_collect_report_secretary`
ADD PRIMARY KEY (`secretary_id`),
ADD KEY `del_flg` (`del_flg`,`start_time`,`end_time`) USING BTREE;
#ユーザ集金情報
CREATE TABLE `user_gold_collect_report` (
`user_no` bigint(20) NOT NULL,
`secretary_id` int(11) NOT NULL DEFAULT '1',
`best_gold_collect_date` date NOT NULL,
`best_gold_collect` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='集金レポート';
ALTER TABLE `user_gold_collect_report`
ADD PRIMARY KEY (`user_no`);