根据坐标得到城市
This commit is contained in:
@@ -222,6 +222,11 @@ func GetCoordinateDistrictCode(ctx *jxcontext.Context, lng, lat float64) (code i
|
||||
return api.AutonaviAPI.GetCoordinateDistrictCode(lng, lat), nil
|
||||
}
|
||||
|
||||
func GetCoordinateTownInfo(ctx *jxcontext.Context, lng, lat float64) (name string, err error) {
|
||||
name, _ = api.AutonaviAPI.GetCoordinateTownInfo(lng, lat)
|
||||
return name, err
|
||||
}
|
||||
|
||||
func SendMsg2Somebody(ctx *jxcontext.Context, mobileNum, verifyCode, msgType, msgContent string) (err error) {
|
||||
if needConfirmRequestMap[msgType] == 1 {
|
||||
if _, err = mobile.AutherObj.VerifySecret(mobileNum, verifyCode); err != nil {
|
||||
|
||||
61
business/partner/purchase/jx/localjx/user.go
Normal file
61
business/partner/purchase/jx/localjx/user.go
Normal file
@@ -0,0 +1,61 @@
|
||||
package localjx
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
)
|
||||
|
||||
type GetJxShopUsersResult struct {
|
||||
model.User
|
||||
RegisterTime time.Time `json:"registerTime"`
|
||||
BuyCount int `json:"buyCount"`
|
||||
ActualPayPrice int `json:"actualPayPrice"`
|
||||
GoodComment string `json:"goodComment"`
|
||||
BadComment string `json:"badComment"`
|
||||
UserMembers []*model.UserMember `json:"userMembers"`
|
||||
}
|
||||
|
||||
func GetJxShopUsers(ctx *jxcontext.Context, keyword string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
var (
|
||||
requestList []*GetJxShopUsersResult
|
||||
db = dao.GetDB()
|
||||
)
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS DISTINCT a.*, b.name user_name, c.name city_name
|
||||
FROM store_audit a
|
||||
JOIN user b ON b.user_id = a.user_id
|
||||
JOIN place c ON c.code = a.city_code
|
||||
WHERE a.deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
// if len(statuss) > 0 {
|
||||
// sql += " AND a.audit_status IN (" + GenQuestionMarks(len(statuss)) + ")"
|
||||
// sqlParams = append(sqlParams, statuss)
|
||||
// }
|
||||
|
||||
if keyword != "" {
|
||||
sql += " AND (a.user_id LIKE ? OR a.name LIKE ? OR a.tel1 LIKE ? OR a.tel2 LIKE ? OR a.address LIKE ?)"
|
||||
sqlParams = append(sqlParams, "%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%")
|
||||
}
|
||||
sql += "LIMIT ? OFFSET ?"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
dao.Begin(db)
|
||||
defer dao.Commit(db)
|
||||
if err = dao.GetRows(db, &requestList, sql, sqlParams...); err == nil {
|
||||
return &model.PagedInfo{
|
||||
TotalCount: dao.GetLastTotalRowCount(db),
|
||||
Data: requestList,
|
||||
}, nil
|
||||
}
|
||||
return pagedInfo, err
|
||||
}
|
||||
Reference in New Issue
Block a user