-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[マイページ]部門予算・詳細取得 #915
base: feat/kubosaka/intro-minio-client-go
Are you sure you want to change the base?
[マイページ]部門予算・詳細取得 #915
Conversation
var selectFestivalItemForMypageQuery = dialect.Select( | ||
goqu.I("users.name").As("userName"), | ||
goqu.I("financial_records.name").As("financialRecordName"), | ||
goqu.I("divisions.id").As("divisionId"), | ||
goqu.I("divisions.name").As("divisionName"), | ||
goqu.I("festival_items.id").As("festivalItemId"), | ||
goqu.I("festival_items.name").As("festivalItemName"), | ||
goqu.I("years.year"), | ||
goqu.COALESCE(goqu.I("item_budgets.amount"), 0).As("budgetAmount"), | ||
goqu.COALESCE(goqu.I("buy_reports.id"), 0).As("buyReportId"), | ||
goqu.COALESCE(goqu.I("buy_reports.paid_by"), "").As("paidBy"), | ||
goqu.COALESCE(goqu.I("buy_reports.amount"), 0).As("reportAmount"), | ||
goqu.COALESCE(goqu.I("buy_reports.created_at"), "2025-01-29 20:53:44").As("reportDate"), | ||
goqu.COALESCE(goqu.I("buy_statuses.is_packed"), 0).As("isPacked"), | ||
goqu.COALESCE(goqu.I("buy_statuses.is_settled"), 0).As("isSettled")). | ||
From("festival_items"). | ||
InnerJoin(goqu.I("divisions"), goqu.On(goqu.I("festival_items.division_id").Eq(goqu.I("divisions.id")))). | ||
InnerJoin(goqu.I("financial_records"), goqu.On(goqu.I("divisions.financial_record_id").Eq(goqu.I("financial_records.id")))). | ||
InnerJoin(goqu.I("user_groups"), goqu.On(goqu.I("divisions.id").Eq(goqu.I("user_groups.group_id")))). | ||
InnerJoin(goqu.I("users"), goqu.On(goqu.I("users.id").Eq(goqu.I("user_groups.user_id")))). | ||
InnerJoin(goqu.I("years"), goqu.On(goqu.I("financial_records.year_id").Eq(goqu.I("years.id")))). | ||
LeftJoin(goqu.I("item_budgets"), goqu.On(goqu.I("festival_items.id").Eq(goqu.I("item_budgets.festival_item_id")))). | ||
LeftJoin(goqu.I("buy_reports"), goqu.On(goqu.I("festival_items.id").Eq(goqu.I("buy_reports.festival_item_id")))). | ||
LeftJoin(goqu.I("buy_statuses"), goqu.On(goqu.I("buy_reports.id").Eq(goqu.I("buy_statuses.buy_report_id")))). | ||
Order(goqu.I("festival_items.id").Desc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これで必要なデータとってくる
type FestivalItemForMyPageColumn struct { | ||
UserName string | ||
FinancialRecordName string | ||
DivisionId int | ||
DivisionName string | ||
FestivalItemId int | ||
FestivalItemName string | ||
Year int | ||
BudgetAmount int | ||
BuyReportId int | ||
PaidBy string | ||
ReportAmount int | ||
ReportDate string | ||
IsPacked bool | ||
IsSettled bool | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取得したdbのデータを入れる用の型
festivalItemForMyPageColumns = append(festivalItemForMyPageColumns, festivalItemForMyPageColumn) | ||
} | ||
|
||
festivalItemDetailsList = convertColumnToGenerated(festivalItemForMyPageColumns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この関数内でdbから取得したデータを整形
resolve #914
概要
/festival_items/details/{user_id}
画面スクリーンショット等
URL
スクリーンショット
テスト項目
備考