Files
jx-callback/business/dao/print_bind_store.go
邹宗楠 7190d106ab 1
2022-08-24 10:44:32 +08:00

32 lines
870 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) error {
param := &model.PrintBindStore{
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
StoreID: req.StoreId,
StoreName: req.Name,
StoreVendor: 9, // 绑定平台,全平台
PrintNo: req.PrintNo,
UserId: "system", // 所属用户
StoreStatus: 1, // 门店开启
BindStatus: 1, // 绑定状态
}
return CreateEntity(GetDB(), param)
}