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
a7b54baa
Commit
a7b54baa
authored
Sep 23, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推荐调整
parent
db99d999
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
132 additions
and
4 deletions
+132
-4
RB_Product_Recommend.cs
Mall.Model/Entity/Product/RB_Product_Recommend.cs
+4
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+80
-4
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+1
-0
UserModule.cs
Mall.Module.User/UserModule.cs
+21
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+3
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+1
-0
AppletUserController.cs
Mall.WebApi/Controllers/User/AppletUserController.cs
+18
-0
No files found.
Mall.Model/Entity/Product/RB_Product_Recommend.cs
View file @
a7b54baa
...
...
@@ -31,6 +31,10 @@ namespace Mall.Model.Entity.Product
set
;
}
/// <summary>
/// 是否优先推荐同类商品 1是 2否
/// </summary>
public
int
?
DetailRecommendSame
{
get
;
set
;
}
/// <summary>
/// 推荐数量
/// </summary>
public
int
?
DetailRecommendNum
...
...
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
a7b54baa
...
...
@@ -122,6 +122,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 排除商品id
/// </summary>
public
int
?
NoGoodsId
{
get
;
set
;
}
/// <summary>
/// 采购商品id
/// </summary>
public
int
?
ProcurementGoodsId
{
get
;
set
;
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
a7b54baa
...
...
@@ -532,9 +532,46 @@ namespace Mall.Module.Product
}
}
}
var
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
List
<
RB_Goods_Extend
>
RList
=
list
;
List
<
RB_Goods_Extend
>
RList
=
new
List
<
RB_Goods_Extend
>();
List
<
RB_Goods_Extend
>
list
=
new
List
<
RB_Goods_Extend
>();
if
(
demodel
.
RecommendType
==
1
&&
rmodel
.
DetailRecommendSame
==
1
&&
demodel
.
GoodsId
>
0
)
{
//根据商品查询出分类
var
categoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsId
=
demodel
.
GoodsId
});
if
(
categoryList
.
Any
())
{
demodel
.
CategoryIds
=
string
.
Join
(
","
,
categoryList
.
Select
(
x
=>
x
.
CategoryId
??
0
).
Distinct
());
demodel
.
NoGoodsId
=
demodel
.
GoodsId
;
demodel
.
GoodsId
=
0
;
//根据分类 查询出商品列表
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
//查看商品数量 不足的 根据以前逻辑查询出来补充
if
(
list
.
Count
()
<
pageSize
)
{
demodel
.
CategoryIds
=
""
;
int
pageSize2
=
pageSize
-
list
.
Count
();
var
list2
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize2
,
out
long
count2
,
demodel
);
if
(
list2
.
Any
())
{
foreach
(
var
item
in
list2
)
{
list
.
Add
(
item
);
}
}
}
RList
=
list
;
}
else
{
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
RList
=
list
;
}
}
else
{
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
RList
=
list
;
}
if
(
list
.
Any
())
{
if
(
demodel
.
RecommendType
==
2
&&
rmodel
.
IsOrderRecommend
==
1
&&
!
string
.
IsNullOrEmpty
(
rmodel
.
OrderProductIds
))
...
...
@@ -635,9 +672,47 @@ namespace Mall.Module.Product
}
}
}
var
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
List
<
RB_Goods_Extend
>
RList
=
list
;
List
<
RB_Goods_Extend
>
RList
=
new
List
<
RB_Goods_Extend
>();
List
<
RB_Goods_Extend
>
list
=
new
List
<
RB_Goods_Extend
>();
if
(
demodel
.
RecommendType
==
1
&&
rmodel
.
DetailRecommendSame
==
1
&&
demodel
.
GoodsId
>
0
)
{
//根据商品查询出分类
var
categoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsId
=
demodel
.
GoodsId
});
if
(
categoryList
.
Any
())
{
demodel
.
CategoryIds
=
string
.
Join
(
","
,
categoryList
.
Select
(
x
=>
x
.
CategoryId
??
0
).
Distinct
());
demodel
.
NoGoodsId
=
demodel
.
GoodsId
;
demodel
.
GoodsId
=
0
;
//根据分类 查询出商品列表
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
//查看商品数量 不足的 根据以前逻辑查询出来补充
if
(
list
.
Count
()
<
pageSize
)
{
demodel
.
CategoryIds
=
""
;
int
pageSize2
=
pageSize
-
list
.
Count
();
var
list2
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize2
,
out
long
count2
,
demodel
);
if
(
list2
.
Any
())
{
foreach
(
var
item
in
list2
)
{
list
.
Add
(
item
);
}
}
}
RList
=
list
;
}
else
{
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
RList
=
list
;
}
}
else
{
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
RList
=
list
;
}
if
(
list
.
Any
())
{
if
(
demodel
.
RecommendType
==
2
&&
rmodel
.
IsOrderRecommend
==
1
&&
!
string
.
IsNullOrEmpty
(
rmodel
.
OrderProductIds
))
...
...
@@ -3697,6 +3772,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Product_Recommend
.
CommentRecommentStatus
),
demodel
.
CommentRecommentStatus
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendNum
),
demodel
.
DetailRecommendNum
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendStatus
),
demodel
.
DetailRecommendStatus
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendSame
),
demodel
.
DetailRecommendSame
},
{
nameof
(
RB_Product_Recommend
.
IsCommentRecommend
),
demodel
.
IsCommentRecommend
},
{
nameof
(
RB_Product_Recommend
.
IsOrderRecommend
),
demodel
.
IsOrderRecommend
},
{
nameof
(
RB_Product_Recommend
.
OrderCompleteStatus
),
demodel
.
OrderCompleteStatus
},
...
...
Mall.Module.User/UserCommonModule.cs
View file @
a7b54baa
...
...
@@ -259,6 +259,7 @@ namespace Mall.Module.User
CreateDate
=
DateTime
.
Now
,
DetailRecommendNum
=
6
,
DetailRecommendStatus
=
1
,
DetailRecommendSame
=
1
,
IsCommentRecommend
=
2
,
IsOrderRecommend
=
2
,
MallBaseId
=
MallBaseId
,
...
...
Mall.Module.User/UserModule.cs
View file @
a7b54baa
...
...
@@ -3998,6 +3998,27 @@ namespace Mall.Module.User
return
RList
;
}
/// <summary>
/// 获取我的线下层级关系
/// </summary>
/// <param name="userId1"></param>
/// <param name="userId2"></param>
/// <returns></returns>
public
ApiResult
GetMyUserHierarchicalRelationList
(
int
userId1
,
int
userId2
)
{
var
umodel
=
member_UserRepository
.
GetEntity
(
userId1
);
var
mymodel
=
member_UserRepository
.
GetEntity
(
userId2
);
if
(
umodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"当前用户不存在"
);
}
if
(
mymodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"用户不存在"
);
}
return
ApiResult
.
Success
();
}
/// <summary>
/// 获取我的团队自定义信息
/// </summary>
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
a7b54baa
...
...
@@ -517,6 +517,9 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(
dmodel
.
NoGoodsId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
<>
{
dmodel
.
NoGoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
SupplierIds
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
in(
{
dmodel
.
SupplierIds
}
)"
;
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
a7b54baa
...
...
@@ -939,6 +939,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
model
.
Id
,
model
.
DetailRecommendStatus
,
model
.
DetailRecommendSame
,
model
.
DetailRecommendNum
,
model
.
OrderCompleteStatus
,
model
.
IsOrderRecommend
,
...
...
Mall.WebApi/Controllers/User/AppletUserController.cs
View file @
a7b54baa
...
...
@@ -865,6 +865,24 @@ namespace Mall.WebApi.Controllers.User
var
robj
=
userModule
.
GetUserVipBuyRecommend
(
GradeId
,
userInfo
);
return
ApiResult
.
Success
(
""
,
robj
);
}
/// <summary>
/// 获取我的用户层级关系图
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMyUserHierarchicalRelationList
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
UserId
=
parms
.
GetInt
(
"UserId"
,
0
);
if
(
UserId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递用户id"
);
}
return
userModule
.
GetMyUserHierarchicalRelationList
(
UserId
,
userInfo
.
UserId
);
}
#
endregion
#
region
会员中心
...
...
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