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
b84aace7
Commit
b84aace7
authored
Jun 19, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
1235e863
056d164d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+29
-17
No files found.
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
b84aace7
...
@@ -170,19 +170,24 @@ namespace Mall.WebApi.Controllers
...
@@ -170,19 +170,24 @@ namespace Mall.WebApi.Controllers
{
{
TenantId
=
TenantId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
GoodsIds
=
Ids
,
GoodsStatus
=
1
});
});
foreach
(
var
lastItem
in
childItem
.
goodsList
)
List
<
GoodsDetailsItem2
>
newGoodsList
=
new
List
<
GoodsDetailsItem2
>();
foreach
(
var
tempGood
in
tempGoodsList
)
{
{
var
tempGood
=
tempGoodsList
?.
Where
(
qitem
=>
qitem
.
Id
==
lastItem
.
id
)?.
FirstOrDefault
();
var
lastItem
=
new
GoodsDetailsItem2
();
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
{
{
lastItem
.
name
=
tempGood
?.
Name
??
lastItem
.
n
ame
;
lastItem
.
name
=
tempGood
.
N
ame
;
lastItem
.
price
=
Math
.
Round
((
tempGood
?.
SellingPrice
??
lastItem
.
price
),
2
);
lastItem
.
price
=
Math
.
Round
((
tempGood
?.
SellingPrice
??
0
),
2
);
lastItem
.
picUrl
=
tempGood
?.
CoverImage
!=
null
?
Common
.
Config
.
GetFileUrl
(
tempGood
.
CoverImage
)
:
Common
.
Config
.
GetFileUrl
(
lastItem
.
picUrl
)
;
lastItem
.
picUrl
=
tempGood
?.
CoverImage
!=
null
?
Common
.
Config
.
GetFileUrl
(
tempGood
.
CoverImage
)
:
""
;
lastItem
.
OriginalPrice
=
Math
.
Round
((
tempGood
?.
OriginalPrice
??
0
),
2
);
lastItem
.
OriginalPrice
=
Math
.
Round
((
tempGood
?.
OriginalPrice
??
0
),
2
);
newGoodsList
.
Add
(
lastItem
);
}
}
}
}
childItem
.
goodsList
=
newGoodsList
;
}
}
}
}
//自动添加商品
//自动添加商品
...
@@ -193,7 +198,8 @@ namespace Mall.WebApi.Controllers
...
@@ -193,7 +198,8 @@ namespace Mall.WebApi.Controllers
{
{
TenantId
=
TenantId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
MallBaseId
=
MallBaseId
,
CategoryIds
=
childItem
.
id
.
ToString
()
CategoryIds
=
childItem
.
id
.
ToString
(),
GoodsStatus
=
1
});
});
if
(
catGoodsList
!=
null
&&
catGoodsList
.
Count
>
0
)
if
(
catGoodsList
!=
null
&&
catGoodsList
.
Count
>
0
)
{
{
...
@@ -223,7 +229,8 @@ namespace Mall.WebApi.Controllers
...
@@ -223,7 +229,8 @@ namespace Mall.WebApi.Controllers
var
goodsList
=
productModule
.
GetProductGoodsPageList
(
1
,
goodsData
.
goodsLength
,
out
long
rowsCount
,
new
Model
.
Extend
.
Product
.
RB_Goods_Extend
()
var
goodsList
=
productModule
.
GetProductGoodsPageList
(
1
,
goodsData
.
goodsLength
,
out
long
rowsCount
,
new
Model
.
Extend
.
Product
.
RB_Goods_Extend
()
{
{
TenantId
=
TenantId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
MallBaseId
=
MallBaseId
,
GoodsStatus
=
1
});
});
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
{
{
...
@@ -250,19 +257,23 @@ namespace Mall.WebApi.Controllers
...
@@ -250,19 +257,23 @@ namespace Mall.WebApi.Controllers
{
{
TenantId
=
TenantId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
GoodsIds
=
Ids
,
GoodsStatus
=
1
});
});
foreach
(
var
childItem
in
goodsData
.
list
)
List
<
GoodsDetailsItem2
>
newGoodsList
=
new
List
<
GoodsDetailsItem2
>();
foreach
(
var
tempGood
in
tempGoodsList
)
{
{
var
tempGood
=
tempGoodsList
?.
Where
(
qitem
=>
qitem
.
Id
==
childItem
.
id
)?.
FirstOrDefault
();
var
childItem
=
new
GoodsDetailsItem2
();
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
if
(
tempGood
!=
null
&&
tempGood
.
Id
>
0
)
{
{
childItem
.
name
=
tempGood
?.
Name
??
childItem
.
name
;
childItem
.
name
=
tempGood
?.
Name
??
""
;
childItem
.
price
=
Math
.
Round
((
tempGood
?.
SellingPrice
??
childItem
.
price
),
2
);
childItem
.
price
=
Math
.
Round
((
tempGood
?.
SellingPrice
??
0
),
2
);
childItem
.
picUrl
=
tempGood
?.
CoverImage
!=
null
?
Common
.
Config
.
GetFileUrl
(
tempGood
.
CoverImage
)
:
Common
.
Config
.
GetFileUrl
(
childItem
.
picUrl
)
;
childItem
.
picUrl
=
tempGood
?.
CoverImage
!=
null
?
Common
.
Config
.
GetFileUrl
(
tempGood
.
CoverImage
)
:
""
;
childItem
.
OriginalPrice
=
Math
.
Round
((
tempGood
?.
OriginalPrice
??
0
),
2
);
childItem
.
OriginalPrice
=
Math
.
Round
((
tempGood
?.
OriginalPrice
??
0
),
2
);
newGoodsList
.
Add
(
childItem
);
}
}
}
}
goodsData
.
list
=
newGoodsList
;
}
}
}
}
}
}
...
@@ -732,11 +743,11 @@ namespace Mall.WebApi.Controllers
...
@@ -732,11 +743,11 @@ namespace Mall.WebApi.Controllers
var
goodsList
=
productModule
.
GetProductGoodsPageList
(
1
,
6
,
out
long
rowsCount
,
new
Model
.
Extend
.
Product
.
RB_Goods_Extend
()
var
goodsList
=
productModule
.
GetProductGoodsPageList
(
1
,
6
,
out
long
rowsCount
,
new
Model
.
Extend
.
Product
.
RB_Goods_Extend
()
{
{
TenantId
=
Convert
.
ToInt32
(
miniProgram
.
TenantId
),
TenantId
=
Convert
.
ToInt32
(
miniProgram
.
TenantId
),
MallBaseId
=
miniProgram
.
MallBaseId
MallBaseId
=
miniProgram
.
MallBaseId
,
GoodsStatus
=
1
,
});
});
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
{
{
foreach
(
var
gItem
in
goodsList
)
foreach
(
var
gItem
in
goodsList
)
{
{
cats
.
goodsList
.
Add
(
new
GoodsDetailsItem2
()
cats
.
goodsList
.
Add
(
new
GoodsDetailsItem2
()
...
@@ -756,7 +767,8 @@ namespace Mall.WebApi.Controllers
...
@@ -756,7 +767,8 @@ namespace Mall.WebApi.Controllers
{
{
TenantId
=
Convert
.
ToInt32
(
miniProgram
.
TenantId
),
TenantId
=
Convert
.
ToInt32
(
miniProgram
.
TenantId
),
MallBaseId
=
miniProgram
.
MallBaseId
,
MallBaseId
=
miniProgram
.
MallBaseId
,
CategoryIds
=
subitem
.
relation_id
.
ToString
()
CategoryIds
=
subitem
.
relation_id
.
ToString
(),
GoodsStatus
=
1
,
});
});
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
{
{
...
...
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