This commit is contained in:
苏尹岚
2021-01-28 09:52:18 +08:00
parent 7deeb4fbd3
commit 599749191b
4 changed files with 17 additions and 8 deletions

View File

@@ -231,6 +231,6 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, maxRadius
return storeList, err
}
func GetVendorOrgCode(ctx *jxcontext.Context, vendorID int, vendorOrgCode string) (vendorOrgs []*model.VendorOrgCode, err error) {
return dao.GetVendorOrgCode(dao.GetDB(), vendorID, vendorOrgCode)
func GetVendorOrgCode(ctx *jxcontext.Context, vendorID int, vendorOrgCode, vendorType string) (vendorOrgs []*model.VendorOrgCode, err error) {
return dao.GetVendorOrgCode(dao.GetDB(), vendorID, vendorOrgCode, vendorType)
}

View File

@@ -32,9 +32,9 @@ func GetNeedUploadDataResource(db *DaoDB) (dataResList []*model.DataResource, er
return dataResList, err
}
func GetVendorOrgCode(db *DaoDB, vendorID int, vendorOrgCode string) (vendorOrgs []*model.VendorOrgCode, err error) {
func GetVendorOrgCode(db *DaoDB, vendorID int, vendorOrgCode, vendorType string) (vendorOrgs []*model.VendorOrgCode, err error) {
sql := `
SELECT vendor_id, vendor_org_code, comment, is_jx_cat
SELECT vendor_id, vendor_org_code, comment, is_jx_cat, is_open
FROM vendor_org_code
WHERE deleted_at = ?
`
@@ -47,6 +47,10 @@ func GetVendorOrgCode(db *DaoDB, vendorID int, vendorOrgCode string) (vendorOrgs
sql += " AND vendor_org_code = ?"
sqlParams = append(sqlParams, vendorOrgCode)
}
if vendorType != "" {
sql += " AND vendor_type = ?"
sqlParams = append(sqlParams, vendorType)
}
err = GetRows(db, &vendorOrgs, sql, sqlParams)
return vendorOrgs, err
}

View File

@@ -1,5 +1,10 @@
package model
const (
VendorOrgTypePlatform = "platform" //外卖平台
VendorOrgTypeDelivery = "delivery" //配送平台
)
type VendorOrgCode struct {
ModelIDCULD
@@ -8,7 +13,7 @@ type VendorOrgCode struct {
Comment string `json:"comment"` //备注
//appkeysecret token等
Type string `json:"type"` //platform 普通平台, delivery 三方配送平台
IsJxCat int `json:"isJxCat"` //是否使用京西分类0默认使用
IsOpen int `json:"isOpen"` //主要三方配送用是否配送默认0表示打开1表示关
VendorType string `json:"vendorType"` //platform 普通平台, delivery 三方配送平台
IsJxCat int `json:"isJxCat"` //是否使用京西分类0默认使用
IsOpen int `json:"isOpen"` //主要三方配送用是否配送默认0表示打开1表示关
}

View File

@@ -137,7 +137,7 @@ func (c *SysController) GetEbaiRTFDetail() {
// @router /GetVendorOrgCode [get]
func (c *SysController) GetVendorOrgCode() {
c.callGetVendorOrgCode(func(params *tSysGetVendorOrgCodeParams) (retVal interface{}, errCode string, err error) {
retVal, err = common.GetVendorOrgCode(params.Ctx, params.VendorID, params.VendorOrgCode)
retVal, err = common.GetVendorOrgCode(params.Ctx, params.VendorID, params.VendorOrgCode, model.VendorOrgTypePlatform)
return retVal, "", err
})
}