|
|
@@ -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) |
|
|
|
} |