|
@@ -123,15 +123,18 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices |
|
|
foreach (var item in dto.GoodsAttributeValueList) |
|
|
foreach (var item in dto.GoodsAttributeValueList) |
|
|
{ |
|
|
{ |
|
|
var updateselect = dellist.FirstOrDefault(x => x.Id == item.Id); |
|
|
var updateselect = dellist.FirstOrDefault(x => x.Id == item.Id); |
|
|
if (updateselect.AttributeValue!=item.AttributeValue|| updateselect.Sort!=item.Sort) |
|
|
|
|
|
|
|
|
if (updateselect!=null) |
|
|
{ |
|
|
{ |
|
|
//更新 |
|
|
|
|
|
BPA_GoodsAttributeValue GoodsAttributeValue = new(); |
|
|
|
|
|
GoodsAttributeValue.Id = item.Id; |
|
|
|
|
|
GoodsAttributeValue.AttributeValue =item.AttributeValue; |
|
|
|
|
|
GoodsAttributeValue.GoodsAttributeId = dto.Id; |
|
|
|
|
|
GoodsAttributeValue.Sort = item.Sort; |
|
|
|
|
|
res = await _db.Updateable(GoodsAttributeValue).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); |
|
|
|
|
|
|
|
|
if (updateselect.AttributeValue != item.AttributeValue || updateselect.Sort != item.Sort) |
|
|
|
|
|
{ |
|
|
|
|
|
//更新 |
|
|
|
|
|
BPA_GoodsAttributeValue GoodsAttributeValue = new(); |
|
|
|
|
|
GoodsAttributeValue.Id = item.Id; |
|
|
|
|
|
GoodsAttributeValue.AttributeValue = item.AttributeValue; |
|
|
|
|
|
GoodsAttributeValue.GoodsAttributeId = dto.Id; |
|
|
|
|
|
GoodsAttributeValue.Sort = item.Sort; |
|
|
|
|
|
res = await _db.Updateable(GoodsAttributeValue).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
//查询id是否存在 |
|
|
//查询id是否存在 |
|
|
if (string.IsNullOrWhiteSpace(item.GoodsAttributeId)) |
|
|
if (string.IsNullOrWhiteSpace(item.GoodsAttributeId)) |
|
|