diff --git a/db/db_fb_pay_assciation_list.go b/db/db_fb_pay_assciation_list.go new file mode 100644 index 0000000..0997b5e --- /dev/null +++ b/db/db_fb_pay_assciation_list.go @@ -0,0 +1,28 @@ +package db + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/db/model" + "xorm.io/xorm" +) + +func GetFbPayAssciationList(eg *xorm.Engine, storeId, subAppid string) *model.FbPayAssociationList { + var data model.FbPayAssociationList + get, err := eg.Where("store_id=? and sub_appid=? ", storeId, subAppid).Get(&data) + if get == false || err != nil { + return nil + } + return &data +} +func SetFbPayAssciation(eg *xorm.Engine, args map[string]string) { + list := GetFbPayAssciationList(eg, args["StoreId"], args["MerchantId"]) + if list != nil { + return + } + var data = model.FbPayAssociationList{ + MerchantId: args["MerchantId"], + StoreId: args["StoreId"], + SubAppid: args["SubAppid"], + Platform: args["Platform"], + } + eg.Insert(&data) +} diff --git a/db/model/fb_pay_association_list.go b/db/model/fb_pay_association_list.go new file mode 100644 index 0000000..9cd4447 --- /dev/null +++ b/db/model/fb_pay_association_list.go @@ -0,0 +1,9 @@ +package model + +type FbPayAssociationList struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + MerchantId string `json:"merchant_id" xorm:"not null comment('商户号') VARCHAR(255)"` + StoreId string `json:"store_id" xorm:"not null comment('商户门店号') VARCHAR(255)"` + SubAppid string `json:"sub_appid" xorm:"not null default '' comment('微信appid') VARCHAR(255)"` + Platform string `json:"platform" xorm:"comment('00:公众号(默认)01:小程序') VARCHAR(255)"` +}