【修复】修复打印机管理列表数据编辑的情况下,未取消其他打印机默认的问题。

This commit is contained in:
jianweie code
2023-08-28 01:31:40 +08:00
parent af81c34aba
commit 8877a6f407

View File

@@ -89,6 +89,12 @@ namespace CoreCms.Net.Repository
//事物处理过程结束 //事物处理过程结束
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
if (bl && oldModel.isDefault)
{
await DbClient.Updateable<CoreCmsPrinter>().SetColumns(p => p.isDefault == false).Where(p => p.id != oldModel.id).ExecuteCommandAsync();
}
jm.code = bl ? 0 : 1; jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;