mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
adjust validation select phase
This commit is contained in:
+1
@@ -10,6 +10,7 @@ BEGIN
|
||||
'daily_checklist_activity_tasks',
|
||||
'daily_checklist_phases',
|
||||
'daily_checklist_tasks',
|
||||
'daily_checklists',
|
||||
'employee_kandangs',
|
||||
'employees',
|
||||
'phase_activities',
|
||||
|
||||
+1
@@ -11,6 +11,7 @@ BEGIN
|
||||
'daily_checklist_activity_tasks',
|
||||
'daily_checklist_phases',
|
||||
'daily_checklist_tasks',
|
||||
'daily_checklists',
|
||||
'employee_kandangs',
|
||||
'employees',
|
||||
'phase_activities',
|
||||
|
||||
@@ -355,9 +355,10 @@ func (r *ClosingRepositoryImpl) SumMarketingWeightAndQtyByProjectFlockKandangIDs
|
||||
Joins("JOIN product_warehouses pw ON pw.id = mp.product_warehouse_id").
|
||||
Joins("JOIN products prod ON prod.id = pw.product_id").
|
||||
Joins("JOIN flags f ON f.flagable_id = prod.id AND f.flagable_type = ?", "products").
|
||||
Joins("JOIN marketing_delivery_products mdp ON mdp.marketing_product_id = mp.id").
|
||||
Where("pw.project_flock_kandang_id IN ?", projectFlockKandangIDs).
|
||||
Where("f.name IN ?", flagNames).
|
||||
Select("COALESCE(SUM(mp.total_weight), 0) AS total_weight, COALESCE(SUM(mp.qty), 0) AS total_qty, COALESCE(SUM(mp.total_price), 0) AS total_price").
|
||||
Select("COALESCE(SUM(mdp.total_weight), 0) AS total_weight, COALESCE(SUM(mdp.usage_qty), 0) AS total_qty, COALESCE(SUM(mp.total_price), 0) AS total_price").
|
||||
Scan(&agg).Error
|
||||
if err != nil {
|
||||
return 0, 0, 0, err
|
||||
@@ -797,7 +798,7 @@ func (r *ClosingRepositoryImpl) detailQuery(
|
||||
) *gorm.DB {
|
||||
db := r.withCtx(ctx).
|
||||
Table(table).
|
||||
Joins("JOIN product_warehouses pw ON "+pwJoinCond).
|
||||
Joins("JOIN product_warehouses pw ON " + pwJoinCond).
|
||||
Joins("JOIN products p ON p.id = pw.product_id")
|
||||
|
||||
db = applyJoins(db, joins...)
|
||||
@@ -1034,7 +1035,7 @@ func (r *ClosingRepositoryImpl) fetchStockLogs(ctx context.Context, kandangID ui
|
||||
COALESCE(sl.increase,0) AS increase,
|
||||
COALESCE(sl.decrease,0) AS decrease,
|
||||
COALESCE(p.product_price,0) AS price,
|
||||
`+movementSelect+`
|
||||
` + movementSelect + `
|
||||
`).
|
||||
Joins("JOIN product_warehouses pw ON pw.id = sl.product_warehouse_id").
|
||||
Joins("JOIN products p ON p.id = pw.product_id").
|
||||
|
||||
@@ -29,7 +29,7 @@ type Query struct {
|
||||
}
|
||||
|
||||
type AssignPhases struct {
|
||||
PhaseIDs string `json:"phase_ids" validate:"required"`
|
||||
PhaseIDs string `json:"phase_ids" validate:"omitempty"`
|
||||
}
|
||||
|
||||
type AssignTask struct {
|
||||
|
||||
Reference in New Issue
Block a user