This commit is contained in:
邹宗楠
2022-12-07 13:48:19 +08:00
parent 9ac68dbb47
commit c3c4855988
3 changed files with 5 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ type PrintNotice struct {
CreatedAt time.Time `orm:"type(datetime)" json:"created_at" db:"created_at"` // 创建时间
UpdatedAt time.Time `orm:"type(datetime)" json:"updated_at" db:"updated_at"` // 更新时间
NoticeType int `orm:"type(int)" json:"notice_type" db:"notice_type"` // 类型(1-广告/2-通知/3帮助)
Msg string `orm:"type(varchar);size(255)" json:"msg" db:"msg"` // 内容(广告就是图片,通知消息就是文字)
Msg string `orm:"type(text)" json:"msg" db:"msg"` // 内容(广告就是图片,通知消息就是文字)
Link string `orm:"type(varchar);size(255)" json:"link" db:"link"` // 跳转地址
}

View File

@@ -20,16 +20,18 @@ func (p *PrintBill) InitPPrintBill(tx *sqlx.Tx, bill *app_model.PrintBill) error
return err
}
// 无打印机账户信息,初始化打印机账户
if len(result) == 0 {
// 无打印机账户信息,初始化打印机账户
if err := dao.InitPrintBill(tx, bill); err != nil {
return err
}
} else if len(result) == 1 && result[0].UserId == "system" {
} else if len(result) == 1 /*&& result[0].UserId == "system"*/ {
// 有打印机账户属于系统
if err := dao.UpdateBillToUser(tx, bill); err != nil {
return err
}
} else {
// 当前情况是打印机被删除过,重新添加
return fmt.Errorf("打印机账户余额数据不唯一,联系管理员")
}

View File

@@ -214,7 +214,6 @@ func (u *UserLogin) GetJxc4Token() (string, error) {
}
jxc4User := &model.CallBack{}
fmt.Println("=============", string(bodyResp))
if err := json.Unmarshal(bodyResp, jxc4User); err != nil {
return "", err
}