Commit 69f66bab authored by 吴春's avatar 吴春

提交代码

parent b9b4e2d5
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.Common.Enum.Goods
{
/// <summary>
/// 订单状态枚举
/// </summary>
public enum OrderStatusesRerveEnum
{
/// <summary>
/// 未付款
/// </summary>
[EnumField("未付款")]
NonPayment = 1,
/// <summary>
/// 待使用
/// </summary>
[EnumField("待使用")]
WaitReceiving = 3,
/// <summary>
/// 已使用
/// </summary>
[EnumField("已使用")]
Received = 4,
/// <summary>
/// 已完成
/// </summary>
[EnumField("已完成")]
Completed = 5,
/// <summary>
/// 待处理
/// </summary>
[EnumField("待处理")]
WaitDeal = 6,
/// <summary>
/// 已取消
/// </summary>
[EnumField("已取消")]
Cancel = 7
}
}
......@@ -349,5 +349,10 @@ namespace Mall.Model.Entity.Product
/// 使用课程卡id
/// </summary>
public int? EducationCouponId { get; set; }
/// <summary>
/// 服务人员的id
/// </summary>
public int? ServicepersonalId { get; set; }
}
}
......@@ -49,5 +49,10 @@ namespace Mall.Model.Extend.Reserve
/// 用户优惠券id
/// </summary>
public string Ids { get; set; }
/// <summary>
/// 线下服务门店id
/// </summary>
public int StoreId { get; set; }
}
}
This diff is collapsed.
......@@ -129,7 +129,7 @@ namespace Mall.Module.Reserve
}
if (model.OrderStateJson == null || model.OrderStateJson == "" || model.OrderStateJson == "[]")
{
var list = EnumHelper.GetEnumList(typeof(Common.Enum.Goods.OrderStatusEnum));
var list = EnumHelper.GetEnumList(typeof(Common.Enum.Goods.OrderStatusesRerveEnum));
model.OrderStateList = list.OrderBy(x => Convert.ToInt32(x.Value)).Select(x => new ReserveStateModel
{
Name = x.Key,
......@@ -506,11 +506,14 @@ namespace Mall.Module.Reserve
{
string Ids = string.Join(",", list.Where(x => x.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Category || x.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Product).Select(x => x.ID));
var listProduct = productRepository.GetListByDiscountCouponIds(query, Ids);
foreach (var item in list)
if (!string.IsNullOrWhiteSpace(Ids))
{
item.ProductList = new List<RB_Reserve_CouponProduct_Extend>();
item.ProductList = listProduct.Where(x => x.CouponId == item.ID).ToList();
var listProduct = productRepository.GetListByDiscountCouponIds(query, Ids);
foreach (var item in list)
{
item.ProductList = new List<RB_Reserve_CouponProduct_Extend>();
item.ProductList = listProduct.Where(x => x.CouponId == item.ID).ToList();
}
}
}
return list;
......
......@@ -87,14 +87,11 @@ where {where} order by c.Id desc";
{
where += $@" and c.{nameof(RB_Goods_Comment.Id)}={dmodel.Id}";
}
if (dmodel.CommentGrade > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.CommentGrade)}={(int)dmodel.CommentGrade}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.GoodsId)}={dmodel.GoodsId}";
}
if (dmodel.UserId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.UserId)}={dmodel.UserId}";
......@@ -179,6 +176,7 @@ where {where} ";
return Get<RB_Goods_Comment_Extend>(sql).ToList();
}
/// <summary>
/// 获取车辆评分信息
/// </summary>
......@@ -217,7 +215,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetGuideCommentByOrderDetailId(string orderDetailIds, int tenantId, int mallBaseId)
public List<RB_Goods_Comment_Extend> GetGuideCommentByOrderDetailId(string orderDetailIds, int tenantId, int mallBaseId)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 and c.{nameof(RB_Goods_Comment.Is_Show)}=1 and c.{nameof(RB_Goods_Comment.GuideId)}>0 ";
if (tenantId > 0)
......@@ -232,7 +230,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
{
where += $@" and c.{nameof(RB_Goods_Comment.OrderDetailId)} in ({orderDetailIds}) ";
}
string sql = $@"SELECT c.*,a.`Name` as GuideName FROM RB_Goods_Comment c LEFT JOIN rb_guidecar_guide as a on c.GuideId=a.ID where {where} ";
return Get<RB_Goods_Comment_Extend>(sql).ToList();
}
......@@ -347,11 +345,114 @@ from rb_goods_comment as c where {where} GROUP BY OrderDetailId) as t GROUP BY t
/// </summary>
/// <param name="goodsId"></param>
/// <returns></returns>
public RB_Goods_Comment_Extend GetGoodsCommentScore(int goodsId) {
public RB_Goods_Comment_Extend GetGoodsCommentScore(int goodsId)
{
string sql = $@"SELECT SUM(CommentScore) AS CommentScore, COUNT(0) AS CommentNum FROM rb_goods_comment WHERE Status =0 and GoodsId = {goodsId}";
return Get<RB_Goods_Comment_Extend>(sql).FirstOrDefault();
}
#region 线下服务
/// <summary>
/// 获取商品和服务人员评分信息
/// </summary>
/// <param name="goodsId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletReserveGoodsCommentscore(int servicepersonalId, int goodsId, int tenantId, int mallBaseId)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 ";
if (tenantId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.TenantId)}={tenantId}";
}
if (mallBaseId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.MallBaseId)}={mallBaseId}";
}
if (servicepersonalId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.ServicePersonalId)}={servicepersonalId}";
}
if (goodsId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.GoodsId)}={goodsId}";
}
string sql = $@"SELECT COUNT(0) as CommentNum,SUM(c.CommentScore) as TotalScore FROM RB_Goods_Comment c
where {where} ";
return Get<RB_Goods_Comment_Extend>(sql).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletReservePageList(int pageIndex, int pageSize, out long count, RB_Goods_Comment_Extend dmodel)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.Id)}={dmodel.Id}";
}
if (dmodel.CommentGrade > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.CommentGrade)}={(int)dmodel.CommentGrade}";
}
if (dmodel.GoodsId > 0 && dmodel.ServicePersonalId > 0)
{
where += $@" and (c.{nameof(RB_Goods_Comment.GoodsId)}={dmodel.GoodsId} or c.{nameof(RB_Goods_Comment.ServicePersonalId)}={dmodel.ServicePersonalId})";
}
else if (dmodel.GoodsId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.GoodsId)}={dmodel.GoodsId}";
}
else if (dmodel.ServicePersonalId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.ServicePersonalId)}={dmodel.ServicePersonalId}";
}
if (dmodel.UserId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.UserId)}={dmodel.UserId}";
}
if (dmodel.PlatformSource > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.PlatformSource)}={(int)dmodel.PlatformSource}";
}
if (dmodel.Is_Show > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.Is_Show)}={dmodel.Is_Show}";
}
if (!string.IsNullOrEmpty(dmodel.UserName))
{
where += $@" and c.{nameof(RB_Goods_Comment.UserName)} like '%{dmodel.UserName}%'";
}
if (!string.IsNullOrEmpty(dmodel.Content))
{
where += $@" and c.{nameof(RB_Goods_Comment.Content)} like '%{dmodel.Content}%'";
}
string sql = $@"SELECT c.* FROM RB_Goods_Comment c where {where} order by c.Is_Top asc,c.Id desc";
return GetPage<RB_Goods_Comment_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
#endregion
}
}
......@@ -234,7 +234,7 @@ SELECT a.ID as MemberCouponId,a.UserId,a.HeXiao,a.UseHeXiao,b.`Name`,b.UseType,b
}
if (query.StoreId > 0)
{
where += $" AND ( a.{nameof(RB_Reserve_Coupon_Extend.StoreId)}={query.StoreId} or a.{nameof(RB_Reserve_Coupon_Extend.StoreId)}=0 ))";
where += $" AND ( a.{nameof(RB_Reserve_Coupon_Extend.StoreId)}={query.StoreId} or a.{nameof(RB_Reserve_Coupon_Extend.StoreId)}=0 )";
}
else
......
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