Commit 7d76889d authored by 黄奎's avatar 黄奎

页面修改

parent d5aae375
...@@ -151,7 +151,7 @@ namespace Mall.Common.Plugin ...@@ -151,7 +151,7 @@ namespace Mall.Common.Plugin
{ {
return string.Format("{0}天前", (int)Math.Floor(span.TotalDays)); return string.Format("{0}天前", (int)Math.Floor(span.TotalDays));
} }
else if (span.TotalDays ==1) else if (span.TotalDays == 1)
{ {
return string.Format("昨天", (int)Math.Floor(span.TotalDays)); return string.Format("昨天", (int)Math.Floor(span.TotalDays));
} }
...@@ -321,7 +321,7 @@ namespace Mall.Common.Plugin ...@@ -321,7 +321,7 @@ namespace Mall.Common.Plugin
} }
} }
/// <summary> /// <summary>
/// 获取年份月份中的最后一天 /// 获取年份月份中的最后一天
/// </summary> /// </summary>
...@@ -1666,5 +1666,23 @@ namespace Mall.Common.Plugin ...@@ -1666,5 +1666,23 @@ namespace Mall.Common.Plugin
} }
return str; return str;
} }
/// <summary>
/// 替换Emoji表情
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string ReplaceEmoji(string str)
{
foreach (var a in str)
{
byte[] bts = Encoding.UTF32.GetBytes(a.ToString());
if (bts[0].ToString() == "253" && bts[1].ToString() == "255")
{
str = str.Replace(a.ToString(), "");
}
}
return str;
}
} }
} }
...@@ -854,8 +854,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -854,8 +854,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
} }
if (!string.IsNullOrEmpty(dmodel.Name) && dmodel.Name.Trim() != "") if (!string.IsNullOrEmpty(dmodel.Name) && dmodel.Name.Trim() != "")
{ {
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like @Name "; string str = Common.Plugin.StringHelper.ReplaceEmoji(dmodel.Name.Trim());
parameters.Add("Name", "%" + dmodel.Name.Trim() + "%"); if (!string.IsNullOrEmpty(str))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like @Name ";
parameters.Add("Name", "%" + str + "%");
}
} }
if (dmodel.GoodsStatus > 0) if (dmodel.GoodsStatus > 0)
{ {
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using Dnc.Api.Throttle; using Dnc.Api.Throttle;
using Mall.CacheManager.User; using Mall.CacheManager.User;
using Mall.Common.API; using Mall.Common.API;
...@@ -2167,6 +2169,19 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -2167,6 +2169,19 @@ namespace Mall.WebApi.Controllers.TradePavilion
} }
#endregion #endregion
var byteData = ExcelTempLateHelper.ToExcelExtend(slist); var byteData = ExcelTempLateHelper.ToExcelExtend(slist);
string basePath = AppDomain.CurrentDomain.BaseDirectory + "/upfile/temporary/brand/";
string path = basePath + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".xls";
if (!Directory.Exists(basePath))
{
Directory.CreateDirectory(basePath);
}
using (FileStream stream =System.IO.File.Create(path))
{
//将字节数组写入流
stream.Write(byteData, 0, byteData.Length);
stream.Close();
}
return File(byteData, "application/octet-stream", ExcelName); return File(byteData, "application/octet-stream", ExcelName);
} }
catch (Exception ex) catch (Exception ex)
......
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