{"action":"created","issue":{"url":"https://api.github.com/repos/opencloset/opencloset/issues/916","repository_url":"https://api.github.com/repos/opencloset/opencloset","labels_url":"https://api.github.com/repos/opencloset/opencloset/issues/916/labels{/name}","comments_url":"https://api.github.com/repos/opencloset/opencloset/issues/916/comments","events_url":"https://api.github.com/repos/opencloset/opencloset/issues/916/events","html_url":"https://github.com/opencloset/opencloset/issues/916","id":167306736,"number":916,"title":"취업날개 이벤트 수치 오류","user":{"login":"yongbin","id":52704,"avatar_url":"https://avatars.githubusercontent.com/u/52704?v=3","gravatar_id":"","url":"https://api.github.com/users/yongbin","html_url":"https://github.com/yongbin","followers_url":"https://api.github.com/users/yongbin/followers","following_url":"https://api.github.com/users/yongbin/following{/other_user}","gists_url":"https://api.github.com/users/yongbin/gists{/gist_id}","starred_url":"https://api.github.com/users/yongbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongbin/subscriptions","organizations_url":"https://api.github.com/users/yongbin/orgs","repos_url":"https://api.github.com/users/yongbin/repos","events_url":"https://api.github.com/users/yongbin/events{/privacy}","received_events_url":"https://api.github.com/users/yongbin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opencloset/opencloset/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"yongbin","id":52704,"avatar_url":"https://avatars.githubusercontent.com/u/52704?v=3","gravatar_id":"","url":"https://api.github.com/users/yongbin","html_url":"https://github.com/yongbin","followers_url":"https://api.github.com/users/yongbin/followers","following_url":"https://api.github.com/users/yongbin/following{/other_user}","gists_url":"https://api.github.com/users/yongbin/gists{/gist_id}","starred_url":"https://api.github.com/users/yongbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongbin/subscriptions","organizations_url":"https://api.github.com/users/yongbin/orgs","repos_url":"https://api.github.com/users/yongbin/repos","events_url":"https://api.github.com/users/yongbin/events{/privacy}","received_events_url":"https://api.github.com/users/yongbin/received_events","type":"User","site_admin":false},"assignees":[{"login":"yongbin","id":52704,"avatar_url":"https://avatars.githubusercontent.com/u/52704?v=3","gravatar_id":"","url":"https://api.github.com/users/yongbin","html_url":"https://github.com/yongbin","followers_url":"https://api.github.com/users/yongbin/followers","following_url":"https://api.github.com/users/yongbin/following{/other_user}","gists_url":"https://api.github.com/users/yongbin/gists{/gist_id}","starred_url":"https://api.github.com/users/yongbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongbin/subscriptions","organizations_url":"https://api.github.com/users/yongbin/orgs","repos_url":"https://api.github.com/users/yongbin/repos","events_url":"https://api.github.com/users/yongbin/events{/privacy}","received_events_url":"https://api.github.com/users/yongbin/received_events","type":"User","site_admin":false},{"login":"keedi","id":138451,"avatar_url":"https://avatars.githubusercontent.com/u/138451?v=3","gravatar_id":"","url":"https://api.github.com/users/keedi","html_url":"https://github.com/keedi","followers_url":"https://api.github.com/users/keedi/followers","following_url":"https://api.github.com/users/keedi/following{/other_user}","gists_url":"https://api.github.com/users/keedi/gists{/gist_id}","starred_url":"https://api.github.com/users/keedi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keedi/subscriptions","organizations_url":"https://api.github.com/users/keedi/orgs","repos_url":"https://api.github.com/users/keedi/repos","events_url":"https://api.github.com/users/keedi/events{/privacy}","received_events_url":"https://api.github.com/users/keedi/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/opencloset/opencloset/milestones/22","html_url":"https://github.com/opencloset/opencloset/milestones/v1.9","labels_url":"https://api.github.com/repos/opencloset/opencloset/milestones/22/labels","id":1724375,"number":22,"title":"v1.9","description":"","creator":{"login":"10001if","id":4696328,"avatar_url":"https://avatars.githubusercontent.com/u/4696328?v=3","gravatar_id":"","url":"https://api.github.com/users/10001if","html_url":"https://github.com/10001if","followers_url":"https://api.github.com/users/10001if/followers","following_url":"https://api.github.com/users/10001if/following{/other_user}","gists_url":"https://api.github.com/users/10001if/gists{/gist_id}","starred_url":"https://api.github.com/users/10001if/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/10001if/subscriptions","organizations_url":"https://api.github.com/users/10001if/orgs","repos_url":"https://api.github.com/users/10001if/repos","events_url":"https://api.github.com/users/10001if/events{/privacy}","received_events_url":"https://api.github.com/users/10001if/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":34,"state":"open","created_at":"2016-04-22T05:27:20Z","updated_at":"2016-08-24T07:14:39Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-07-25T08:06:13Z","updated_at":"2016-08-30T08:54:06Z","closed_at":null,"body":"현재 서울시에 제공하는 취업날개 이벤트 통계페이지에 수치 계산에 오류가 있습니다.\r\n\r\n![screen shot 2016-07-25 at 5 05 19 pm](https://cloud.githubusercontent.com/assets/52704/17094416/142cdf02-528a-11e6-87b6-f55f8a88fabe.png)\r\n"},"comment":{"url":"https://api.github.com/repos/opencloset/opencloset/issues/comments/243375508","html_url":"https://github.com/opencloset/opencloset/issues/916#issuecomment-243375508","issue_url":"https://api.github.com/repos/opencloset/opencloset/issues/916","id":243375508,"user":{"login":"yongbin","id":52704,"avatar_url":"https://avatars.githubusercontent.com/u/52704?v=3","gravatar_id":"","url":"https://api.github.com/users/yongbin","html_url":"https://github.com/yongbin","followers_url":"https://api.github.com/users/yongbin/followers","following_url":"https://api.github.com/users/yongbin/following{/other_user}","gists_url":"https://api.github.com/users/yongbin/gists{/gist_id}","starred_url":"https://api.github.com/users/yongbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongbin/subscriptions","organizations_url":"https://api.github.com/users/yongbin/orgs","repos_url":"https://api.github.com/users/yongbin/repos","events_url":"https://api.github.com/users/yongbin/events{/privacy}","received_events_url":"https://api.github.com/users/yongbin/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T08:54:06Z","updated_at":"2016-08-30T08:54:06Z","body":"제가 판단하기에 이 이슈는 여러가지 문제가 복합적으로 작용하고 있는것 같습니다. 위에 @keedi 님이 말씀해주신 내용 이외에 제가 확인한 사항을 먼저 공유합니다.\r\n\r\n`events_seoul` 의 구현부에서 열린옷장의 예약 인원에 대한 수치계산은 예약시점(`booking`.`date`)을 기준으로 하는데, 취업날개의 수치계산은 쿠폰갱신시점(`coupon`.`update_date`)를 기준으로 하고 있습니다(아래코드)\r\n\r\n```perl\r\n    ## 월별 취업날개 예약/방문\r\n    my $monthly_events = $self->DB->storage->dbh_do(\r\n        sub {\r\n            my ( $storage, $dbh, @args ) = @_;\r\n            $dbh->selectall_arrayref(\r\n                qq{SELECT DATE_FORMAT(c.update_date, '%Y-%m'), c.status, COUNT(c.status)\r\nFROM (SELECT DISTINCT(coupon_id)\r\nFROM `order`\r\nWHERE coupon_id IS NOT NULL) o\r\nJOIN coupon c ON o.coupon_id = c.id\r\nWHERE c.desc LIKE 'seoul%' GROUP BY DATE_FORMAT(c.update_date, '%Y-%m'), c.status}\r\n            );\r\n        },\r\n    );\r\n\r\n    for my $row (@$monthly_events) {\r\n        my ( $ym, $status, $c ) = @$row;\r\n\r\n        $counts{monthly}{$ym}{events}{visited}     = $c if $status eq 'used';\r\n        $counts{monthly}{$ym}{events}{not_visited} = $c if $status eq 'provided';\r\n    }\r\n\r\n```\r\n일반적으로 생각할때 쿠폰을 발행한 뒤, 예약을 진행하기때문에 예약시점은 쿠폰의 발행시점보다는 앞설수 없습니다. 하지만 형석님이 말씀하신 **예약이후 쿠폰의 상태가 변경되는 상황** 이 발생할 경우 쿠폰의 갱신시점은 언제가 될 지 알수 없기때문에 이 시점을 쿠폰의 발행시점이라고 생각하는것은 문제가 생길수 있습니다.\r\n\r\n실재로 4,5,6월의 자료를 확인해본 결과 \r\n\r\n - 4월 예약에 사용된 쿠폰중 4건이 예약시점보다 쿠폰발행시점이 더 뒤입니다. 그중 한건은 쿠폰사용시점이 5월입니다\r\n - 5월 예약에 사용된 쿠폰중 17건이 예약시점보다 쿠폰발행시점이 더 뒤입니다. 그중 두건은 쿠폰사용시점이 6월입니다.\r\n - 6월 예약에 사용된 쿠폰중 9건이 예약시점보다 쿠폰발행시점이 더 뒤입니다. 그중 두건은 쿠폰사용시점이 7월입니다. \r\n\r\n이 이슈도 전체 계산을 안맞게 하는 원인중 하나입니다.\r\n"}}
{"actor":{"display_login":"yongbin"}}