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
16491b3a
Commit
16491b3a
authored
Jun 01, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
13157878
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
33 deletions
+144
-33
UserModule.cs
Mall.Module.User/UserModule.cs
+68
-27
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+58
-1
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+18
-5
No files found.
Mall.Module.User/UserModule.cs
View file @
16491b3a
...
...
@@ -2627,6 +2627,8 @@ namespace Mall.Module.User
#
region
个人中心
/// <summary>
/// 获取个人中心统计
/// </summary>
...
...
@@ -2634,27 +2636,64 @@ namespace Mall.Module.User
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
GetAppletUserCenterStatistics
(
int
userId
,
int
tenantId
,
int
mallBaseId
)
public
object
GetAppletUserCenterStatistics
(
string
openId
)
{
var
objData
=
new
object
();
var
umodel
=
member_UserRepository
.
GetMemberUserEntityRepository
(
new
RB_Member_User_Extend
()
{
OpenId
=
openId
});
if
(
umodel
!=
null
&&
umodel
.
Id
>
0
)
{
var
umodel
=
member_UserRepository
.
GetEntity
(
userId
);
//获取我的收藏
int
CollectionNum
=
member_CollectionRepository
.
GetMyCollectionNum
(
new
RB_Member_Collection_Extend
()
{
UserId
=
userId
,
TenantId
=
tenantId
,
MallBaseId
=
m
allBaseId
});
int
CollectionNum
=
member_CollectionRepository
.
GetMyCollectionNum
(
new
RB_Member_Collection_Extend
()
{
UserId
=
umodel
.
Id
,
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
M
allBaseId
});
//获取我的足迹
int
FootmarkNum
=
member_FootmarkRepository
.
GetMyFootmarkNum
(
userId
,
tenantId
,
m
allBaseId
);
int
FootmarkNum
=
member_FootmarkRepository
.
GetMyFootmarkNum
(
umodel
.
Id
,
umodel
.
TenantId
,
umodel
.
M
allBaseId
);
//订单状态
List
<
RB_Goods_Order_Extend
>
olist
=
goods_OrderRepository
.
GetAppletGoodsOrderNumStatistics
(
userId
,
tenantId
,
m
allBaseId
);
List
<
RB_Goods_Order_Extend
>
olist
=
goods_OrderRepository
.
GetAppletGoodsOrderNumStatistics
(
umodel
.
Id
,
umodel
.
TenantId
,
umodel
.
M
allBaseId
);
//待评价
int
WaitCommentNum
=
goods_OrderRepository
.
GetAppletGoodsOrderWaitCommentNum
(
userId
,
tenantId
,
m
allBaseId
);
int
WaitCommentNum
=
goods_OrderRepository
.
GetAppletGoodsOrderWaitCommentNum
(
umodel
.
Id
,
umodel
.
TenantId
,
umodel
.
M
allBaseId
);
//售后处理中
int
AfterSaleNum
=
goods_OrderRepository
.
GetAppletGoodsOrderAfterSaleNum
(
userId
,
tenantId
,
mallBaseId
);
return
ApiResult
.
Success
(
""
,
new
{
CollectionNum
,
FootmarkNum
,
umodel
.
Integral
,
umodel
.
CouponsNum
,
umodel
.
CardVolumeNum
,
MyOrder
=
new
int
AfterSaleNum
=
goods_OrderRepository
.
GetAppletGoodsOrderAfterSaleNum
(
umodel
.
Id
,
umodel
.
TenantId
,
umodel
.
MallBaseId
);
string
parent_name
=
""
;
if
(
umodel
.
SuperiorId
!=
null
)
{
if
(
umodel
.
SuperiorId
==
0
)
{
parent_name
=
"总店"
;
}
else
if
(
umodel
.
SuperiorId
>
0
)
{
parent_name
=
member_UserRepository
.
GetEntity
<
RB_Member_User_Extend
>(
umodel
.
SuperiorId
)?.
Name
??
""
;
}
}
objData
=
new
{
//昵称
nickname
=
umodel
?.
Name
??
""
,
//电话
mobile
=
umodel
?.
Moblie
??
""
,
//头像
avatar
=
umodel
?.
Photo
??
""
,
//积分
integral
=
umodel
?.
Integral
??
0
,
//余额
balance
=
umodel
?.
Balance
??
0
,
//选项todo
options
=
new
{
},
//收藏 todo
favorite
=
CollectionNum
,
//足迹
footprint
=
FootmarkNum
,
//优惠券
coupon
=
umodel
.
CouponsNum
,
//卡券
card
=
umodel
.
CardVolumeNum
,
//标识
identity
=
new
{
parent_name
,
member_level
=
umodel
.
MemberGrade
,
level_name
=
umodel
.
MemberGradeName
,
is_admin
=
0
,
},
MyOrder
=
new
{
NonPayment
=
olist
.
Where
(
x
=>
x
.
OrderStatus
==
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
NonPayment
).
FirstOrDefault
()?.
OrderNum
??
0
,
WaitSendGoods
=
olist
.
Where
(
x
=>
x
.
OrderStatus
==
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
WaitSendGoods
).
FirstOrDefault
()?.
OrderNum
??
0
,
...
...
@@ -2662,7 +2701,9 @@ namespace Mall.Module.User
WaitCommentNum
,
AfterSaleNum
}
});
};
}
return
objData
;
}
#
endregion
...
...
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
16491b3a
...
...
@@ -437,8 +437,65 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={use
return
new
List
<
RB_Member_User_Extend
>();
}
/// <summary>
/// 根据查询条件获取用户实体类
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
RB_Member_User_Extend
GetMemberUserEntityRepository
(
RB_Member_User_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
string
where
=
" 1=1 "
;
if
(
query
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
TenantId
)}
=
{
query
.
TenantId
}
"
;
}
if
(
query
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
;
}
if
(
query
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Id
)}
=
{
query
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Name
)}
like '%
{
query
.
Name
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
query
.
AliasName
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
AliasName
)}
like '%
{
query
.
AliasName
}
%'"
;
}
if
(
query
.
Source
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Source
)}
=
{(
int
)
query
.
Source
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Moblie
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Moblie
)}
like '%
{
query
.
Moblie
}
%'"
;
}
if
(
query
.
MemberGrade
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
MemberGrade
)}
=
{
query
.
MemberGrade
}
"
;
}
if
(
query
.
SuperiorId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
SuperiorId
)}
=
{
query
.
SuperiorId
}
"
;
}
if
(
query
.
IsEmptyUserPhoto
==
1
)
{
where
+=
$@" and IFNULL(
{
nameof
(
RB_Member_User
.
Photo
)}
,'')=''"
;
}
//HK06-01新增查询条件
if
(
query
.
OpenId
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
OpenId
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
OpenId
)}
= '%
{
query
.
OpenId
}
%'"
;
}
string
sql
=
$@"select * from RB_Member_User where
{
where
}
"
;
return
Get
<
RB_Member_User_Extend
>(
sql
).
FirstOrDefault
();
}
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
16491b3a
...
...
@@ -1167,11 +1167,18 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
var
user_info
=
new
object
();
if
(
RequestParm
.
OpenId
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
RequestParm
.
OpenId
))
{
var
memberModel
=
userModule
.
GetAppletUserCenterStatistics
(
RequestParm
.
OpenId
);
user_info
=
memberModel
;
}
var
objResult
=
new
{
home_pages
=
homePage
,
navbar
=
navbar
navbar
=
navbar
,
user_info
};
return
ApiResult
.
Success
(
data
:
objResult
);
}
...
...
@@ -1719,9 +1726,15 @@ namespace Mall.WebApi.Controllers.MallBase
[
AllowAnonymous
]
public
ApiResult
GetUserInfo
()
{
var
obj
=
new
{
};
return
ApiResult
.
Success
();
if
(
RequestParm
.
OpenId
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
RequestParm
.
OpenId
))
{
var
memberModel
=
userModule
.
GetAppletUserCenterStatistics
(
RequestParm
.
OpenId
);
return
ApiResult
.
Success
(
data
:
new
{
user_info
=
memberModel
});
}
else
{
return
ApiResult
.
Failed
(
message
:
"请获取用户OpenId"
);
}
}
}
}
\ No newline at end of file
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