builder.Append($" SELECT a.*,b.`Name` as CarBrand FROM {TableName} as a LEFT JOIN {CarBrandTableName} as b on a.CarBrandId=b.ID WHERE a.{nameof(RB_GuideCar_Car_Extend.Status)}=0");
builder.Append(@$" SELECT a.*,b.`Name` as CarBrand,c.GoodsNum,d.OrderNum FROM {TableName} as a LEFT JOIN {CarBrandTableName} as b on a.CarBrandId=b.ID
builder.Append($" SELECT a.*,b.SiteName FROM {TableName} as a LEFT JOIN {SiteTableName} as b on a.SiteId=b.ID WHERE a.{nameof(RB_GuideCar_Guide_Extend.Status)}=0");
builder.Append(@$" SELECT a.*,b.SiteName,c.GoodsNum,d.OrderNum FROM {TableName} as a LEFT JOIN {SiteTableName} as b on a.SiteId=b.ID
where+=$@" and o.{nameof(RB_Goods_Order.SmallShopsId)}={dmodel.SmallShopsId}";
}
if(dmodel.IsSelectPayMoney==1)
{
where+=$@" and o.{nameof(RB_Goods_Order.PaymentTime)} IS NOT NULL";
}
stringsql=$@"SELECT o.*,u.Name as UserName,sshop.`Name` as SmallShopsName,gcg.`Name` as GuideName,gcg.GuidePhoto,gcg.Telephone as GuideTelephone FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
INNER JOIN rb_member_user u on o.UserId=u.Id
LEFT JOIN rb_smallshops_info as sshop on o.SmallShopsId=sshop.Id
LEFT JOIN rb_guidecar_guide as gcg on gcg.ID=od.GuideId
where {where} group by o.OrderId order by o.CreateDate desc";