From a8fd0a7a1efeef68447ff0a958ea2a0c44b431b8 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 11 Dec 2023 15:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/db_fb_pay_assciation_list.go | 28 ++++++++++++++++++++++++++++ db/model/fb_pay_association_list.go | 9 +++++++++ 2 files changed, 37 insertions(+) create mode 100644 db/db_fb_pay_assciation_list.go create mode 100644 db/model/fb_pay_association_list.go 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)"` +}