Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
7d76889d
Commit
7d76889d
authored
Nov 26, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
d5aae375
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
4 deletions
+41
-4
StringHelper.cs
Mall.Common/Plugin/StringHelper.cs
+20
-2
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+6
-2
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+15
-0
No files found.
Mall.Common/Plugin/StringHelper.cs
View file @
7d76889d
...
@@ -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
;
}
}
}
}
}
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
7d76889d
...
@@ -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
)
{
{
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
7d76889d
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment