From 8877a6f4079d70e508144ae0cc962518c9e1ae5a Mon Sep 17 00:00:00 2001 From: jianweie code Date: Mon, 28 Aug 2023 01:31:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=89=93=E5=8D=B0=E6=9C=BA=E7=AE=A1=E7=90=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E7=BC=96=E8=BE=91=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=EF=BC=8C=E6=9C=AA=E5=8F=96=E6=B6=88=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E6=89=93=E5=8D=B0=E6=9C=BA=E9=BB=98=E8=AE=A4=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs b/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs index 3ad064c8..45aade6a 100644 --- a/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs +++ b/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs @@ -89,6 +89,12 @@ namespace CoreCms.Net.Repository //事物处理过程结束 var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); + + if (bl && oldModel.isDefault) + { + await DbClient.Updateable().SetColumns(p => p.isDefault == false).Where(p => p.id != oldModel.id).ExecuteCommandAsync(); + } + jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;