aa
This commit is contained in:
@@ -128,19 +128,19 @@ func UpdatePrinter(appID int, printNo string, name, sim, sound *string, volume *
|
||||
if printers, _ := dao.GetPrinters(db, appID, printNo); len(printers) == 0 {
|
||||
return fmt.Errorf("该应用下未找到该打印机!print_no : %v", printNo)
|
||||
} else {
|
||||
if printers[0].Name != *name {
|
||||
if name != nil && printers[0].Name != *name {
|
||||
printers[0].Name = *name
|
||||
fields = append(fields, "name")
|
||||
}
|
||||
if printers[0].SIM != *sim {
|
||||
if sim != nil && printers[0].SIM != *sim {
|
||||
printers[0].SIM = *sim
|
||||
fields = append(fields, "sim")
|
||||
}
|
||||
if printers[0].Sound != *sound {
|
||||
if sound != nil && printers[0].Sound != *sound {
|
||||
printers[0].Sound = *sound
|
||||
fields = append(fields, "sound")
|
||||
}
|
||||
if printers[0].Volume != *volume {
|
||||
if volume != nil && printers[0].Volume != *volume {
|
||||
printers[0].Volume = *volume
|
||||
fields = append(fields, "volume")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user