This commit is contained in:
邹宗楠
2026-03-30 09:11:19 +08:00
parent af8e4a2b74
commit 9c106cd511
4 changed files with 110 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
package dao
import (
"git.rosy.net.cn/jx-callback/business/model"
"time"
)
// StoreInformationStatistics 门店信息统计
func StoreInformationStatistics() (result []*model.EffectiveStores, err error) {
sql := `
SELECT
gs.jx_store_id,
MAX(sm.vendor_org_code) AS vendor_org_code,
MAX(sm.vendor_store_id) AS vendor_store_id,
MAX(sm.mtwm_token) AS mtwm_token
FROM goods_order gs
LEFT JOIN store_map sm ON gs.jx_store_id = sm.store_id AND gs.vendor_id = sm.vendor_id
WHERE gs.order_created_at >= ?
AND gs.vendor_id = ?
GROUP BY gs.jx_store_id;
`
parma := []interface{}{time.Now().AddDate(0, -1, 0), model.VendorIDMTWM}
if err = GetRows(GetDB(), &result, sql, parma...); err != nil {
return nil, err
}
return
}