バグ #636
レポート差分自動調整バッチbugfix
| ステータス: | 新規 | 開始日: | 2016/01/27 | |
|---|---|---|---|---|
| 優先度: | 通常 | 期日: | 2016/01/29 | |
| 担当者: | 山本 義治 | 進捗 %: | 0% | |
| カテゴリ: | ログ系 | 作業時間の記録: | 1.00時間 | |
| 対象バージョン: | - |
説明
・PIDデータの集計漏れ
例)710: まんがこっち(SP)
・手動承認データの集計漏れ
例)1454: コレカラ進路.jp
履歴
#2 山本 義治 がほぼ10年前に更新
・登録日、承認日が日を跨った場合の対応
・月を跨った場合の対応
[admin@web1 cron]$ diff stat_log_convert_test.php stat_log_convert.php
11c11
< $stat_month = date("Ym", strtotime($interval));
---
> $stat_month = date("Ym");
44,48d43
< //承認日が当日でない場合登録数カウントしない
< if(preg_match('/^'.$stat_date.'/', $admit_date))
< $admit_date_flg = 1;
< else
< $admit_date_flg = 0;
54c49
< if($status > 0 && $admit_date_flg){
---
> if($status > 0)
56,58c51,52
< $stat_log_count[$c_id][$item_id][$p_id][$asp_id]['action_cost_'.$career] += $commission_cost;
< $stat_log_count[$c_id][$item_id][$p_id][$asp_id]['action_cost_cl_'.$career] += $commission_cost_cl;
< }
---
> $stat_log_count[$c_id][$item_id][$p_id][$asp_id]['action_cost_'.$career] += $commission_cost;
> $stat_log_count[$c_id][$item_id][$p_id][$asp_id]['action_cost_cl_'.$career] += $commission_cost_cl;
65c59
< if($status > 0 && $admit_date_flg){
---
> if($status > 0)
67,69c61,62
< $stat_log_count[$c_id][$item_id][$p_id][$m_id]['action_cost_'.$career] += $commission_cost;
< $stat_log_count[$c_id][$item_id][$p_id][$m_id]['action_cost_cl_'.$career] += $commission_cost_cl;
< }
---
> $stat_log_count[$c_id][$item_id][$p_id][$m_id]['action_cost_'.$career] += $commission_cost;
> $stat_log_count[$c_id][$item_id][$p_id][$m_id]['action_cost_cl_'.$career] += $commission_cost_cl;
74c67
< if($status > 0 && $admit_date_flg){
---
> if($status > 0)
76,78c69,70
< $stat_log_media_count[$m_id]['action_cost_'.$career] += $commission_cost;
< $stat_log_media_count[$m_id]['action_cost_cl_'.$career] += $commission_cost_cl;
< }
---
> $stat_log_media_count[$m_id]['action_cost_'.$career] += $commission_cost;
> $stat_log_media_count[$m_id]['action_cost_cl_'.$career] += $commission_cost_cl;
84c76
< if($status > 0 && $admit_date_flg){
---
> if($status > 0)
86,89c78,80
< $stat_log_client_count[$c_id]['action_cost_'.$career] += $commission_cost;
< $stat_log_client_count[$c_id]['action_cost_cl_'.$career] += $commission_cost_cl;
< }
< if($order_date_flg){
---
> $stat_log_client_count[$c_id]['action_cost_'.$career] += $commission_cost;
> $stat_log_client_count[$c_id]['action_cost_cl_'.$career] += $commission_cost_cl;
> if($order_date_flg)
91,94c82
< $total_action_cost += $action_cost;
< $total_action_cost_cl += $action_cost_cl;
< }
< if($status > 0 && $admit_date_flg){
---
> if($status > 0)
96,98c84,87
< $total_commission_cost += $commission_cost;
< $total_commission_cost_cl += $commission_cost_cl;
< }
---
> $total_action_cost += $action_cost;
> $total_action_cost_cl += $action_cost_cl;
> $total_commission_cost += $commission_cost;
> $total_commission_cost_cl += $commission_cost_cl;
#3 山本 義治 がほぼ10年前に更新
手動承認案件用に過去3ヶ月分取得
[admin@web1 cron]$ diff stat_log_convert_test.php stat_log_convert.php
12,14d11
< $stat_month_1 = date("Ym", strtotime("-1 month"));
< $stat_month_2 = date("Ym", strtotime("-2 month"));
< $stat_month_3 = date("Ym", strtotime("-3 month"));
16,19c13
< $sql = "select * from action_log_".$stat_month." where ((order_date >= '$start_date' and order_date <= '$end_date') or (admit_date >= '$start_date' and admit_date <= '$end_date'))
< union select * from action_log_".$stat_month_1." where ((order_date >= '$start_date' and order_date <= '$end_date') or (admit_date >= '$start_date' and admit_date <= '$end_date'))
< union select * from action_log_".$stat_month_2." where ((order_date >= '$start_date' and order_date <= '$end_date') or (admit_date >= '$start_date' and admit_date <= '$end_date'))
< union select * from action_log_".$stat_month_3." where ((order_date >= '$start_date' and order_date <= '$end_date') or (admit_date >= '$start_date' and admit_date <= '$end_date'))";
---
> $sql = "select * from action_log_".$stat_month." where (order_date >= '$start_date' and order_date <= '$end_date') or (admit_date >= '$start_date' and admit_date <= '$end_date')";
88c82
< if($order_date_flg){
---
> if($order_date_flg)
89a84,89
> if($status > 0 && $admit_date_flg){
> $stat_log_client_count[$c_id]['admit_count_'.$career]++;
> $stat_log_client_count[$c_id]['action_cost_'.$career] += $commission_cost;
> $stat_log_client_count[$c_id]['action_cost_cl_'.$career] += $commission_cost_cl;
> }
> if($order_date_flg){
95,97d94
< $stat_log_client_count[$c_id]['admit_count_'.$career]++;
< $stat_log_client_count[$c_id]['action_cost_'.$career] += $commission_cost;
< $stat_log_client_count[$c_id]['action_cost_cl_'.$career] += $commission_cost_cl;
208c205
< //$tres = __mysql_query_ex($tsql);
---
> $tres = __mysql_query_ex($tsql);
266c263
< //$tres = __mysql_query_ex($tsql);
---
> $tres = __mysql_query_ex($tsql);
320c317
< //$tres = __mysql_query_ex($tsql);
---
> $tres = __mysql_query_ex($tsql);