1
This commit is contained in:
29
business/model/dao/mt_avtivity_station.go
Normal file
29
business/model/dao/mt_avtivity_station.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user