Commit 9b4e3bd4 authored by 吴春's avatar 吴春

提交代码

parent cbcafbef
......@@ -5,6 +5,7 @@ using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Entity.BaseSetUp;
using Mall.Model.Extend.BaseSetUp;
using Mall.Common.Enum.GuideCar;
namespace Mall.Model.Extend.Product
{
......@@ -33,6 +34,22 @@ namespace Mall.Model.Extend.Product
/// 导游名称
/// </summary>
public string GuideName { get; set; }
/// <summary>
/// 从业年限
/// </summary>
public decimal GuideWorkYears { get; set; }
/// <summary>
/// 用户评分
/// </summary>
public decimal GuideScore { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string GuideTelephone { get; set; }
/// <summary>
/// 车辆名称
/// </summary>
......@@ -50,6 +67,13 @@ namespace Mall.Model.Extend.Product
public string RegionIds { get; set; }
/// <summary>
/// 车辆品牌
/// </summary>
public int? CarBrandId { get; set; }
#endregion
/// <summary>
......
This diff is collapsed.
......@@ -119,6 +119,10 @@ namespace Mall.Repository.GuideCar
{
builder.Append($" AND a.{nameof(RB_GuideCar_Guide_Extend.ID)}={query.ID}");
}
if (query.SiteId > 0)
{
builder.Append($" AND a.{nameof(RB_GuideCar_Guide_Extend.SiteId)}={query.SiteId}");
}
if (!string.IsNullOrEmpty(query.GuideIds))
{
builder.Append($" AND a.{nameof(RB_GuideCar_Guide_Extend.ID)} in({query.GuideIds})");
......
......@@ -829,7 +829,7 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
/// <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";
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and gcg.Status=0 and c.Status=0 and d.Status=0 and f.Status=0 and b.IsReserve=1 and a.AdvanceDay<=datediff(b.Date,NOW()) 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}";
......@@ -849,11 +849,17 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
if (dmodel.CarType.HasValue&& (int)dmodel.CarType > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.CarType)}={(int)dmodel.CarType}";
if (dmodel.CarType==Common.Enum.Goods.GuideCarGoodsTypeEnum.Line)
{
if (dmodel.IsSpell > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsSpell)}={dmodel.IsSpell}";
}
}
}
if (!string.IsNullOrEmpty(dmodel.RegionIds))
{
where += $@" and e.RegionId in({dmodel.RegionIds}) ";
where += $@" and d.RegionId in({dmodel.RegionIds}) ";
}
if (!string.IsNullOrEmpty(dmodel.LineName))
{
......@@ -867,23 +873,18 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
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 (dmodel.CarBrandId.HasValue && dmodel.CarBrandId > 0)
{
where += $@" and e.CarBrandId={dmodel.CarBrandId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
......@@ -902,12 +903,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
}
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"}'";
where += $@" and b.Date >='{dmodel.StartTime}'";
}
//if (!string.IsNullOrEmpty(dmodel.EndTime))
//{
// where += $@" and b.Date <='{dmodel.EndTime + " 23:59:59"}'";
//}
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
......@@ -920,7 +921,6 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
string orderBy = " g.Sort desc";
if (dmodel.OrderBy == 1)
{
......@@ -962,17 +962,13 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
//最新降序
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
string sql = $@"SELECT g.*,c.SiteName,e.`Name` as CarName,e.CarType as GuideCarType,f.ColorName as CarColorName,gcg.Name as GuideName,gcg.WorkYears as GuideWorkYears,gcg.Score as GuideScore,gcg.Telephone as GuideTelephone 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
LEFT JOIN rb_guidecar_siteregion as d on d.SiteId=g.SiteId
LEFT JOIN rb_guidecar_carcolor as f on f.ID=g.CarColorId
LEFT JOIN rb_guidecar_guide as gcg on gcg.ID=g.GuideId
where {where} GROUP BY g.Id order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
......
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