根据坐标得到城市
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
|
||||
}
|
||||
@@ -139,6 +139,21 @@ func (c *CmsController) GetCoordinateDistrictCode() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 根据坐标得到城市
|
||||
// @Description 根据坐标得到城市
|
||||
// @Param token header string true "认证token"
|
||||
// @Param lng query number true "经度"
|
||||
// @Param lat query number true "纬度"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetCoordinateTownInfo [get]
|
||||
func (c *CmsController) GetCoordinateTownInfo() {
|
||||
c.callGetCoordinateTownInfo(func(params *tCmsGetCoordinateTownInfoParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.GetCoordinateTownInfo(params.Ctx, params.Lng, params.Lat)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 得到配置参数
|
||||
// @Description 得到配置参数
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
@@ -283,3 +283,18 @@ func (c *JxOrderController) TestDefend() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询京西商城用户信息
|
||||
// @Description 查询京西商城用户信息
|
||||
// @Param token header string true "认证token"
|
||||
// @Param keyword query string false "关键字"
|
||||
// @Param offset query int false "结果起始序号(以0开始,缺省为0)"
|
||||
// @Param pageSize query int false "结果页大小(缺省为50,-1表示全部)"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetJxShopUsers [get]
|
||||
func (c *JxOrderController) GetJxShopUsers() {
|
||||
c.callGetJxShopUsers(func(params *tJxorderGetJxShopUsersParams) (retVal interface{}, errCode string, err error) {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -286,6 +286,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetCoordinateTownInfo",
|
||||
Router: `/GetCoordinateTownInfo`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetNewOrderMsg",
|
||||
@@ -691,6 +700,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetJxShopUsers",
|
||||
Router: `/GetJxShopUsers`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetMatterOrderStatus",
|
||||
|
||||
Reference in New Issue
Block a user