aa
This commit is contained in:
@@ -513,7 +513,6 @@ func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresIn
|
|||||||
func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interface{}, offset, pageSize int, orderTimeFrom, orderTimeTo time.Time, orderCountFrom, orderCountTo int) (retVal *StoresInfo, err error) {
|
func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interface{}, offset, pageSize int, orderTimeFrom, orderTimeTo time.Time, orderCountFrom, orderCountTo int) (retVal *StoresInfo, err error) {
|
||||||
briefLevel := int(utils.ForceInterface2Int64(params["briefLevel"]))
|
briefLevel := int(utils.ForceInterface2Int64(params["briefLevel"]))
|
||||||
//权限
|
//权限
|
||||||
//权限
|
|
||||||
if permission.IsRoled(ctx) {
|
if permission.IsRoled(ctx) {
|
||||||
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
||||||
var storeIDs2 []int
|
var storeIDs2 []int
|
||||||
@@ -544,12 +543,12 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sql, sqlParams, _, _, err := getStoresSql(ctx, keyword, params, orderTimeFrom, orderTimeTo)
|
sql, sqlParams, _, _, err := getStoresSql(ctx, keyword, params, orderTimeFrom, orderTimeTo)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
sql = `
|
sql = `
|
||||||
SELECT
|
SELECT
|
||||||
|
SQL_CALC_FOUND_ROWS
|
||||||
DISTINCT t1.*,
|
DISTINCT t1.*,
|
||||||
-- CAST(t1.lng AS DECIMAL(15,6))/1000000 float_lng,
|
-- CAST(t1.lng AS DECIMAL(15,6))/1000000 float_lng,
|
||||||
-- CAST(t1.lat AS DECIMAL(15,6))/1000000 float_lat,
|
-- CAST(t1.lat AS DECIMAL(15,6))/1000000 float_lat,
|
||||||
@@ -580,8 +579,10 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
|||||||
//mapLimit := false
|
//mapLimit := false
|
||||||
//globals.SugarLogger.Debug(sql)
|
//globals.SugarLogger.Debug(sql)
|
||||||
//globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
//globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||||
|
txDB , _ := dao.Begin(db)
|
||||||
if err = dao.GetRows(db, &storeList, sql, sqlParams...); err == nil {
|
if err = dao.GetRowsTx(txDB, &storeList, sql, sqlParams...); err == nil {
|
||||||
|
retVal.Stores = storeList
|
||||||
|
retVal.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
|
||||||
// 地图区域限制过滤
|
// 地图区域限制过滤
|
||||||
//if mapLongitude2, ok := params["mapLongitude"].(string); ok {
|
//if mapLongitude2, ok := params["mapLongitude"].(string); ok {
|
||||||
// var (
|
// var (
|
||||||
@@ -648,10 +649,8 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
|||||||
task.Run()
|
task.Run()
|
||||||
task.GetResult(0)
|
task.GetResult(0)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
dao.Commit(db, txDB)
|
||||||
if len(retVal.Stores) > 0 {
|
if len(retVal.Stores) > 0 {
|
||||||
setStoreMapInfo(ctx, db, retVal, storeIDs, briefLevel, params["isBussinessStatus"])
|
setStoreMapInfo(ctx, db, retVal, storeIDs, briefLevel, params["isBussinessStatus"])
|
||||||
retVal.MapCenterLng, retVal.MapCenterLat = getMapCenter(retVal.Stores)
|
retVal.MapCenterLng, retVal.MapCenterLat = getMapCenter(retVal.Stores)
|
||||||
|
|||||||
Reference in New Issue
Block a user