huangjiajun 3 weeks ago
parent
commit
7fb014c702
3 changed files with 8 additions and 8 deletions
  1. +3
    -3
      app/db/db_store.go
  2. +1
    -1
      app/db/model/community_team_store_qrcode.go
  3. +4
    -4
      app/store/svc/svc_qrcode.go

+ 3
- 3
app/db/db_store.go View File

@@ -37,9 +37,9 @@ func GetStore(eg *xorm.Engine, arg map[string]string) []map[string]string {
if arg["store_id"] != "" {
where += " and uid = '" + arg["store_id"] + "'"
}
if arg["city"] != "" {
where += " and city like '%" + arg["city"] + "%'"
}
//if arg["city"] != "" {
// where += " and city like '%" + arg["city"] + "%'"
//}
if arg["province_id"] != "" {
where += " and province_id = '" + arg["province_id"] + "'"
}


+ 1
- 1
app/db/model/community_team_store_qrcode.go View File

@@ -3,7 +3,7 @@ package model
type CommunityTeamStoreQrcode struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"default 0 INT(11)"`
TableNum int `json:"table_num" xorm:"default 0 INT(11)"`
TableNum string `json:"table_num" xorm:"VARCHAR(255)"`
Type int `json:"type" xorm:"default 0 INT(11)"`
IsUse int `json:"is_use" xorm:"default 0 INT(11)"`
Name string `json:"name" xorm:"VARCHAR(255)"`


+ 4
- 4
app/store/svc/svc_qrcode.go View File

@@ -16,7 +16,7 @@ import (
func QrcodePayStyle(c *gin.Context) {
eg := svc.MasterDb(c)
user := svc.GetUser(c)
m, _ := SysModDataBySkipIdentifier(c, "pub.flutter.o2o_store_qrcode_style")
m, _ := SysModDataBySkipIdentifier(c, "pub.flutter.community_store_qrcode_style")
bytes := utils.MarshalJSONCamelCase2JsonSnakeCase(m.Data)
m.Data = string(bytes)
fmt.Println(m.Data)
@@ -65,7 +65,7 @@ func Qrcode(c *gin.Context) {
for _, v := range *cate {
tmp := map[string]string{
"id": utils.IntToStr(v.Id),
"table_num": utils.IntToStr(v.TableNum),
"table_num": v.TableNum,
"name": v.Name,
"is_use": utils.IntToStr(v.IsUse),
"qrcode": "",
@@ -92,14 +92,14 @@ func QrcodeSave(c *gin.Context) {
user := svc.GetUser(c)
if arg["id"] != "" {
data := db.GetStoreQrcodeById(svc.MasterDb(c), arg["id"])
data.TableNum = utils.StrToInt(arg["table_num"])
data.TableNum = arg["table_num"]
data.Name = arg["name"]
data.IsUse = utils.StrToInt(arg["is_use"])
svc.MasterDb(c).Where("id=?", data.Id).Update(data)
} else {
data := &model.CommunityTeamStoreQrcode{
Uid: user.Info.Uid,
TableNum: utils.StrToInt(arg["table_num"]),
TableNum: arg["table_num"],
IsUse: utils.StrToInt(arg["is_use"]),
Name: arg["name"],
}


Loading…
Cancel
Save