【新增】表【CoreCmsGoods】增加【initialSales】初始销量字段。

【新增】业务逻辑增加可设置的虚假销量,用于展示友好销量。
【优化】后端使用增加版本号更新,方便对比当前版本信息,通过后台右上角进入查阅。
This commit is contained in:
大灰灰
2022-07-15 23:50:27 +08:00
parent d122d4505e
commit b5c5e97583
14 changed files with 74 additions and 23 deletions

View File

@@ -523,13 +523,14 @@ namespace CoreCms.Net.Services
model.isFav = await _goodsCollectionServices.ExistsAsync(p => p.goodsId == model.id && p.userId == userId);
}
//取默认货品
var products = await _productsServices.QueryByClauseAsync(p => p.goodsId == model.id && p.isDefalut == true && p.isDel == false);
model.sku = await _productsServices.QueryListByClauseAsync(p => p.goodsId == model.id && p.isDel == false);
if (!model.sku.Any()) return null;
var products = model.sku.Find(p => p.isDefalut);
if (products == null) return null;
var getProductInfo = await _productsServices.GetProductInfo(products.id, isPromotion, userId, type, groupId);
if (getProductInfo == null) return null;
model.product = getProductInfo;
model.sn = getProductInfo.sn;
model.price = getProductInfo.price;
model.costprice = getProductInfo.costprice;
@@ -552,7 +553,7 @@ namespace CoreCms.Net.Services
model.brand = brand;
//取出销量
model.buyCount = await _orderItemServices.GetCountAsync(p => p.goodsId == model.id);
model.buyCount = model.initialSales + await _orderItemServices.GetSumAsync(p => p.goodsId == model.id, o => o.nums, true);
return model;
}
#endregion
@@ -625,7 +626,6 @@ namespace CoreCms.Net.Services
#endregion
#region
/// <summary>
/// 重写根据条件查询数据
@@ -641,10 +641,9 @@ namespace CoreCms.Net.Services
}
#endregion
#region
#region
/// <summary>
/// 重写根据条件查询分页数据
/// 重写根据条件及自定义排序查询分页数据
/// </summary>
/// <param name="predicate"></param>
/// <param name="orderBy"></param>