From d80cf370cc6263529de2690517a84ca296625dd5 Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Mon, 20 May 2024 17:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E7=A9=BA=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataBase/Services/GoodsService.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs index be3feb6..9d3e1dc 100644 --- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs +++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs @@ -462,15 +462,17 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services GoodsUintName = SqlFunc.Subqueryable().Where(s => s.Id == a.GoodsUintId && s.IsDeleted == 0).Select(s => s.Name), //GoodsAttributeList = new List() }).FirstAsync(); - if (!res.IsAttrubute) + if (res!=null) { - res.GoodsAttributeList = await _goodsAttributeService.GetByNameAttribute("默认属性"); - } - else - { - res.GoodsAttributeList = await _goodsAttributeService.GetByGoodsIdAttribute(res.Id); + if (!res.IsAttrubute) + { + res.GoodsAttributeList = await _goodsAttributeService.GetByNameAttribute("默认属性"); + } + else + { + res.GoodsAttributeList = await _goodsAttributeService.GetByGoodsIdAttribute(res.Id); + } } - return res; } public async Task ExportGood(IFormFile file)