Files
jx-callback/business/dao/print_bind_store.go
邹宗楠 9212f14ffd 1
2022-12-16 11:48:19 +08:00

38 lines
935 B
Go

package dao
import (
"git.rosy.net.cn/jx-callback/business/model"
"time"
)
// QueryPrintBindStore 查询绑定门店
func QueryPrintBindStore(printNo string) ([]*model.PrintBindStore, error) {
var data []*model.PrintBindStore
if err := GetRows(GetDB(), &data, `SELECT * FROM print_bind_store WHERE print_no = ?`, []interface{}{printNo}...); err != nil {
return nil, err
}
return data, nil
}
// BindStoreList 绑定门店信息
func BindStoreList(req *model.AddPrinterParam, userId string) error {
param := &model.PrintBindStore{
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
StoreID: req.StoreId,
StoreName: req.Name,
StoreVendor: 9, // 绑定平台,全平台
PrintNo: req.PrintNo,
StoreStatus: 1, // 门店开启
BindStatus: 1, // 绑定状态
}
if userId != "" {
param.UserId = userId
} else {
param.UserId = "system"
}
return CreateEntity(GetDB(), param)
}
// 删除绑定门店