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
a39cce4a
Commit
a39cce4a
authored
Oct 22, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1412e63b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
143 additions
and
7 deletions
+143
-7
RB_Miniprogram_Admin_Extend.cs
Mall.Model/Extend/User/RB_Miniprogram_Admin_Extend.cs
+25
-4
RB_Miniprogram_AdminRepository.cs
Mall.Repository/User/RB_Miniprogram_AdminRepository.cs
+16
-3
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+102
-0
No files found.
Mall.Model/Extend/User/RB_Miniprogram_Admin_Extend.cs
View file @
a39cce4a
using
Mall.Model.Entity.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Common.Enum.User
;
using
Mall.Model.Entity.User
;
namespace
Mall.Model.Extend.User
{
...
...
@@ -10,6 +8,29 @@ namespace Mall.Model.Extend.User
/// </summary>
public
class
RB_Miniprogram_Admin_Extend
:
RB_Miniprogram_Admin
{
/// <summary>
/// 头像
/// </summary>
public
string
Photo
{
get
;
set
;
}
/// <summary>
/// 手机号码
/// </summary>
public
string
Moblie
{
get
;
set
;
}
/// <summary>
/// 昵称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// OpenId
/// </summary>
public
string
OpenId
{
get
;
set
;
}
/// <summary>
/// 来源
/// </summary>
public
UserSourceEnum
Source
{
get
;
set
;
}
}
}
Mall.Repository/User/RB_Miniprogram_AdminRepository.cs
View file @
a39cce4a
...
...
@@ -4,6 +4,8 @@ using System;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
using
Mall.Common.Enum
;
using
VT.FW.DB.Dapper
;
namespace
Mall.Repository.User
{
...
...
@@ -22,12 +24,14 @@ namespace Mall.Repository.User
/// <returns></returns>
public
List
<
RB_Miniprogram_Admin_Extend
>
GetMiniprogramAdminPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Miniprogram_Admin_Extend
query
)
{
DynamicParameters
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM rb_miniprogram_admin AS A
SELECT A.*
,B.Photo,B.Moblie,B.`Name`,B.OpenId,B.Source
FROM rb_miniprogram_admin AS A
LEFT JOIN rb_member_user AS B ON A.UserId=B.Id
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Miniprogram_Admin_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
...
...
@@ -38,8 +42,17 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Miniprogram_Admin_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Name
))
{
builder
.
AppendFormat
(
$@" and B.
{
nameof
(
RB_Miniprogram_Admin_Extend
.
Name
)}
like @Name "
);
parameters
.
Add
(
"Name"
,
"%"
+
query
.
Name
.
Trim
()
+
"%"
);
}
if
(
query
.
Source
>
0
)
{
builder
.
AppendFormat
(
" AND B.{0}={1} "
,
nameof
(
RB_Miniprogram_Admin_Extend
.
Source
),
(
int
)
query
.
Source
);
}
}
return
GetPage
<
RB_Miniprogram_Admin_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Miniprogram_Admin_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()
,
parameters
).
ToList
();
}
}
}
Mall.WebApi/Controllers/User/UserController.cs
View file @
a39cce4a
...
...
@@ -40,8 +40,16 @@ namespace Mall.WebApi.Controllers.User
_accessor
=
accessor
;
}
/// <summary>
/// 小程序用户处理类
/// </summary>
private
readonly
UserModule
userModule
=
new
UserModule
();
/// <summary>
/// 小程序管理员处理类
/// </summary>
private
readonly
MiniprogramAdminModule
adminModule
=
new
MiniprogramAdminModule
();
#
region
用户管理
/// <summary>
/// 获取用户分页列表
...
...
@@ -876,6 +884,100 @@ namespace Mall.WebApi.Controllers.User
#
endregion
#
region
小程序管理员
/// <summary>
/// 获取小程序管理员分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMiniprogramAdminPage
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_Miniprogram_Admin_Extend
demodel
=
new
RB_Miniprogram_Admin_Extend
()
{
UserId
=
parms
.
GetInt
(
"UserId"
),
Name
=
parms
.
GetStringValue
(
"Name"
),
Source
=(
UserSourceEnum
)
parms
.
GetInt
(
"Source"
),
};
demodel
.
TenantId
=
Convert
.
ToInt32
(
RequestParm
.
uid
);
demodel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
var
list
=
adminModule
.
GetMiniprogramAdminPageModule
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
AdminId
,
x
.
UserId
,
x
.
Photo
,
x
.
Name
,
x
.
Moblie
,
x
.
OpenId
,
x
.
Source
,
SourceName
=
x
.
Source
.
GetEnumName
(),
CreateDate
=
Common
.
ConvertHelper
.
FormatTime
(
x
.
CreateDate
),
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 新增修改小程序管理员
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetMiniprogramAdmin
()
{
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
RB_Miniprogram_Admin_Extend
demodel
=
new
RB_Miniprogram_Admin_Extend
()
{
AdminId
=
parms
.
GetInt
(
"AdminId"
),
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
RequestParm
.
MallBaseId
,
TenantId
=
RequestParm
.
TenantId
,
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
,
UpdateDate
=
DateTime
.
Now
,
UserId
=
parms
.
GetInt
(
"UserId"
),
};
if
(
demodel
.
UserId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择小程序用户!"
);
}
bool
flag
=
adminModule
.
SetMiniprogramAdminModule
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 删除小程序管理员
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
DeleteMiniprogramAdmin
()
{
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
AdminId
=
parms
.
GetInt
(
"AdminId"
);
if
(
AdminId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择小程序用户!"
);
}
bool
flag
=
adminModule
.
RemoveMiniprogramAdminModule
(
AdminId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
#
region
分销商基础
/// <summary>
...
...
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