Skip to content

Commit

Permalink
Merge pull request #89 from hyosung-second-team1/85-jsp-vote-distance
Browse files Browse the repository at this point in the history
[Fix] 그룹 일정 옮긴 출발 위치 반영 안 되는 문제 해결
  • Loading branch information
Koneweekk authored May 16, 2024
2 parents bb3f869 + 282f4c5 commit e1209c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/mapper/scheduleMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@
m.img_src,
ms.is_owner,
dp.place_name AS departure_place_name,
dp.lat AS departure_lat,
dp.lng AS departure_lng
dp.lat,
dp.lng
FROM
member m
JOIN member_schedule ms ON m.email = ms.email
Expand Down
24 changes: 13 additions & 11 deletions src/main/resources/static/js/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,25 +239,25 @@ async function getBarData() {
const year = today.getFullYear();

const data = {
labels: [],
labels: [1,2,3,4,5,6,7,8,9,10,11,12],
datasets: [
{
label: '전체',
data: [],
data: new Array(12).fill(0),
borderColor: '#4FD1C5',
backgroundColor: '#4FD1C5',
borderWidth: 2,
},
{
label: '그룹',
data: [],
data: new Array(12).fill(0),
borderColor: '#4FD1C5',
backgroundColor: '#4FD1C5',
borderWidth: 2,
},
{
label: '개인',
data: [],
data: new Array(12).fill(0),
borderColor: '#4FD1C5',
backgroundColor: '#4FD1C5',
borderWidth: 2,
Expand All @@ -269,23 +269,25 @@ async function getBarData() {
const response1 = await aj.getMonthStatic(year);
const countData1 = response1.data;

$.each(countData1, function (idx, month) {
data.labels.push(month.month);
data.datasets[0].data.push(month.scheduleCount);
$.each(countData1, function (idx, month) {
const monthIdx = Number(month.month) - 1;
data.datasets[0].data[monthIdx] = month.scheduleCount;
});

// 그룹 일정
const response2 = await aj.getMonthStatic(year, true);
const countData2 = response1.data;
const countData2 = response2.data;
$.each(countData2, function (idx, month) {
data.datasets[1].data.push(month.scheduleCount);
const monthIdx = Number(month.month) - 1;
data.datasets[0].data[monthIdx] = month.scheduleCount;
});

// 개인 일정
const response3 = await aj.getMonthStatic(year, false);
const countData3 = response1.data;
const countData3 = response3.data;
$.each(countData3, function (idx, month) {
data.datasets[2].data.push(month.scheduleCount);
const monthIdx = Number(month.month) - 1;
data.datasets[0].data[monthIdx] = month.scheduleCount;
});

return data
Expand Down

0 comments on commit e1209c7

Please sign in to comment.