Commit 52ca89f3 authored by 吴春's avatar 吴春

提交代码

parent e152d55a
......@@ -42,6 +42,14 @@ namespace Mall.Model.Extend.Product
/// </summary>
public string CarColorName { get; set; }
/// <summary>
/// 车辆类型
/// </summary>
public int? CarClass { get; set; }
public string RegionIds { get; set; }
#endregion
/// <summary>
......
......@@ -3145,7 +3145,7 @@ namespace Mall.Module.Product
{
new WhereHelper (){ FiledName=nameof(RB_GuideCar_CarBrand.ID),FiledValue=model.ID,OperatorEnum=OperatorEnum.Equal}
};
carBrandRepository.Update(filedsRegion, whereHelpersRegion);
flag= carBrandRepository.Update(filedsRegion, whereHelpersRegion);
}
}
catch (Exception ex)
......
......@@ -816,6 +816,167 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
string sql = $@"select g.* from RB_Goods g where {where}";
return Get<RB_Goods_Extend>(sql).ToList();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_Extend> GetAppletPageListForCar(int pageIndex, int pageSize, out long rowCount, RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.GoodsClassify=1 and g.{nameof(RB_Goods_Extend.GoodsStatus)}=1";
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.NotTenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}<>{dmodel.NotTenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
if (dmodel.CarType.HasValue&& (int)dmodel.CarType > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.CarType)}={(int)dmodel.CarType}";
}
if (!string.IsNullOrEmpty(dmodel.RegionIds))
{
where += $@" and e.RegionId in({dmodel.RegionIds}) ";
}
if (!string.IsNullOrEmpty(dmodel.LineName))
{
where += $@" and g.{nameof(RB_Goods_Extend.LineName)} like'%{dmodel.LineName}%' ";
}
if (!string.IsNullOrEmpty(dmodel.LineDescription))
{
where += $@" and g.{nameof(RB_Goods_Extend.LineDescription)} like'%{dmodel.LineDescription}%' ";
}
if (dmodel.UseDay > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.UseDay)}={dmodel.UseDay}";
}
if (dmodel.IsSpell > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsSpell)}={dmodel.IsSpell}";
}
if (dmodel.RideNum > 0)
{
where += $@" and (g.{nameof(RB_Goods_Extend.RideNum)}-b.ReserveNum)>={dmodel.RideNum}";
}
if (dmodel.CarClass.HasValue&& dmodel.CarClass > 0)
{
where += $@" and e.CarClass={dmodel.CarClass}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.IsSelectSellOut == 1)
{
where += $@" and g.{nameof(RB_Goods_Extend.InventoryNum)}<=0";
}
if (!string.IsNullOrEmpty(dmodel.CategoryIds))
{
where += $@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
}
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
}
if (dmodel.IsProxy > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
string orderBy = " g.Sort desc";
if (dmodel.OrderBy == 1)
{
//价格升序
orderBy = " g.Sort asc";
}
else if (dmodel.OrderBy == 2)
{
//价格降序
orderBy = " g.Sort desc";
}
else if (dmodel.OrderBy ==3)
{
//价格升序
orderBy = " g.SellingPrice asc";
}
else if (dmodel.OrderBy == 4)
{
//价格降序
orderBy = " g.SellingPrice desc";
}
else if (dmodel.OrderBy == 5)
{
//评分升序
orderBy = " e.Score asc";
}
else if (dmodel.OrderBy == 6)
{
//评分降序
orderBy = " e.Score desc";
}
else if (dmodel.OrderBy ==7)
{
//最新升序
orderBy = " g.CreateDate asc";
}
else if (dmodel.OrderBy == 8)
{
//最新降序
orderBy = " g.CreateDate desc";
}
// e.CarClass = 1
//and g.CarType = 1 and g.LineName like'%川藏%' and g.LineDescription like'%成都%'
//and g.UseDay = 2 and g.IsSpell = 1 and(g.RideNum - b.ReserveNum) >= 4 and d.RegionId in(4)
string sql = $@"SELECT g.*,c.SiteName,e.`Name` as CarName from rb_goods as g
LEFT JOIN rb_goods_targetdate as b on g.Id=b.GoodsId
LEFT JOIN rb_guidecar_site as c on g.SiteId=c.ID
LEFT JOIN rb_guidecar_car as e on e.ID=g.CarId
LEFT JOIN rb_guidecar_siteregion d on d.SiteId=g.SiteId
where {where} GROUP BY g.Id order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
#endregion
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment