mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
adjust query
This commit is contained in:
@@ -358,7 +358,7 @@ func (r *ClosingRepositoryImpl) SumMarketingWeightAndQtyByProjectFlockKandangIDs
|
|||||||
Joins("JOIN marketing_delivery_products mdp ON mdp.marketing_product_id = mp.id").
|
Joins("JOIN marketing_delivery_products mdp ON mdp.marketing_product_id = mp.id").
|
||||||
Where("pw.project_flock_kandang_id IN ?", projectFlockKandangIDs).
|
Where("pw.project_flock_kandang_id IN ?", projectFlockKandangIDs).
|
||||||
Where("f.name IN ?", flagNames).
|
Where("f.name IN ?", flagNames).
|
||||||
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").
|
Select("COALESCE(SUM(mdp.total_weight), 0) AS total_weight, COALESCE(SUM(mdp.usage_qty), 0) AS total_qty, COALESCE(SUM(mdp.total_price), 0) AS total_price").
|
||||||
Scan(&agg).Error
|
Scan(&agg).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, 0, err
|
return 0, 0, 0, err
|
||||||
|
|||||||
Reference in New Issue
Block a user