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
a31dcc37
Commit
a31dcc37
authored
Jun 02, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
和平分销
parent
1c5ff295
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1431 additions
and
1 deletion
+1431
-1
RB_Distributor_HPCategory.cs
Mall.Model/Entity/User/RB_Distributor_HPCategory.cs
+66
-0
RB_Distributor_HPCommission.cs
Mall.Model/Entity/User/RB_Distributor_HPCommission.cs
+86
-0
RB_Distributor_HPGradeInfo.cs
Mall.Model/Entity/User/RB_Distributor_HPGradeInfo.cs
+74
-0
RB_Distributor_HPGradeRatio.cs
Mall.Model/Entity/User/RB_Distributor_HPGradeRatio.cs
+70
-0
RB_Distributor_Info.cs
Mall.Model/Entity/User/RB_Distributor_Info.cs
+4
-0
RB_Distributor_HPCategory_Extend.cs
Mall.Model/Extend/User/RB_Distributor_HPCategory_Extend.cs
+25
-0
RB_Distributor_HPCommission_Extend.cs
Mall.Model/Extend/User/RB_Distributor_HPCommission_Extend.cs
+38
-0
RB_Distributor_HPGradeInfo_Extend.cs
Mall.Model/Extend/User/RB_Distributor_HPGradeInfo_Extend.cs
+18
-0
RB_Distributor_HPGradeRatio_Extend.cs
Mall.Model/Extend/User/RB_Distributor_HPGradeRatio_Extend.cs
+29
-0
RB_Distributor_Info_Extend.cs
Mall.Model/Extend/User/RB_Distributor_Info_Extend.cs
+4
-0
UserModule.cs
Mall.Module.User/UserModule.cs
+492
-0
RB_Distributor_HPCategoryRepository.cs
Mall.Repository/User/RB_Distributor_HPCategoryRepository.cs
+46
-0
RB_Distributor_HPCommissionRepository.cs
....Repository/User/RB_Distributor_HPCommissionRepository.cs
+99
-0
RB_Distributor_HPGradeInfoRepository.cs
Mall.Repository/User/RB_Distributor_HPGradeInfoRepository.cs
+80
-0
RB_Distributor_HPGradeRatioRepository.cs
....Repository/User/RB_Distributor_HPGradeRatioRepository.cs
+46
-0
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+254
-1
No files found.
Mall.Model/Entity/User/RB_Distributor_HPCategory.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 和平分销返佣适配分类表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPCategory
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 和平返佣id
/// </summary>
public
int
?
CommissionId
{
get
;
set
;
}
/// <summary>
/// 分类id
/// </summary>
public
int
?
CategoryId
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_HPCommission.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 和平分销返佣表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPCommission
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 分销返佣名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 小数类型 1取整 2保留两位小数 (向上进一)
/// </summary>
public
int
?
DecimalType
{
get
;
set
;
}
/// <summary>
/// 是否启用 1是 2否
/// </summary>
public
int
?
Enabled
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_HPGradeInfo.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 和平等级表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPGradeInfo
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 等级名称
/// </summary>
public
string
GradeName
{
get
;
set
;
}
/// <summary>
/// 等
/// </summary>
public
int
?
Grade
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_HPGradeRatio.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 和平分销返佣等级表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPGradeRatio
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 和平返佣id
/// </summary>
public
int
?
CommissionId
{
get
;
set
;
}
/// <summary>
/// 等级id
/// </summary>
public
int
?
GradeId
{
get
;
set
;
}
/// <summary>
/// 返佣比例 成本/(1-比例)=应卖价;实付-应卖 = 返佣
/// </summary>
public
decimal
?
CommissionRatio
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_Info.cs
View file @
a31dcc37
...
@@ -67,6 +67,10 @@ namespace Mall.Model.Entity.User
...
@@ -67,6 +67,10 @@ namespace Mall.Model.Entity.User
set
;
set
;
}
}
/// <summary>
/// <summary>
/// 和平分销等级id
/// </summary>
public
int
?
HPGradeId
{
get
;
set
;
}
/// <summary>
/// 审核状态 1审核中 2通过 3拒绝
/// 审核状态 1审核中 2通过 3拒绝
/// </summary>
/// </summary>
public
DistributorAuditStatusEnum
?
AuditStatus
public
DistributorAuditStatusEnum
?
AuditStatus
...
...
Mall.Model/Extend/User/RB_Distributor_HPCategory_Extend.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 和平分销返佣适配分类表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPCategory_Extend
:
RB_Distributor_HPCategory
{
/// <summary>
/// 和平分类ids
/// </summary>
public
string
CommissionIds
{
get
;
set
;
}
/// <summary>
/// 分类名称
/// </summary>
public
string
CategoryName
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_HPCommission_Extend.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 和平分销返佣表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPCommission_Extend
:
RB_Distributor_HPCommission
{
/// <summary>
/// 分类id
/// </summary>
public
int
?
CategoryId
{
get
;
set
;
}
/// <summary>
/// 分类ids
/// </summary>
public
string
CategoryIds
{
get
;
set
;
}
/// <summary>
/// 分类ids
/// </summary>
public
string
CategoryIdsT
{
get
;
set
;
}
/// <summary>
/// 分类列表
/// </summary>
public
List
<
RB_Distributor_HPCategory_Extend
>
CategoryList
{
get
;
set
;
}
/// <summary>
/// 比例列表
/// </summary>
public
List
<
RB_Distributor_HPGradeRatio_Extend
>
RatioList
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_HPGradeInfo_Extend.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 和平等级表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPGradeInfo_Extend
:
RB_Distributor_HPGradeInfo
{
}
}
Mall.Model/Extend/User/RB_Distributor_HPGradeRatio_Extend.cs
0 → 100644
View file @
a31dcc37
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 和平分销返佣等级表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_HPGradeRatio_Extend
:
RB_Distributor_HPGradeRatio
{
/// <summary>
/// 和平返佣Id
/// </summary>
public
string
CommissionIds
{
get
;
set
;
}
/// <summary>
/// 等级
/// </summary>
public
int
?
Grade
{
get
;
set
;
}
/// <summary>
/// 等级名称
/// </summary>
public
string
GradeName
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_Info_Extend.cs
View file @
a31dcc37
...
@@ -36,6 +36,10 @@ namespace Mall.Model.Extend.User
...
@@ -36,6 +36,10 @@ namespace Mall.Model.Extend.User
/// </summary>
/// </summary>
public
string
GradeName
{
get
;
set
;
}
public
string
GradeName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 和平等级名称
/// </summary>
public
string
HPGradeName
{
get
;
set
;
}
/// <summary>
/// 上级id
/// 上级id
/// </summary>
/// </summary>
public
int
?
SuperiorId
{
get
;
set
;
}
public
int
?
SuperiorId
{
get
;
set
;
}
...
...
Mall.Module.User/UserModule.cs
View file @
a31dcc37
This diff is collapsed.
Click to expand it.
Mall.Repository/User/RB_Distributor_HPCategoryRepository.cs
0 → 100644
View file @
a31dcc37
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System.Linq
;
namespace
Mall.Repository.User
{
/// <summary>
/// 和平分销商品分类仓储层
/// </summary>
public
class
RB_Distributor_HPCategoryRepository
:
RepositoryBase
<
RB_Distributor_HPCategory
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_HPCategory_Extend
>
GetList
(
RB_Distributor_HPCategory_Extend
dmodel
)
{
string
where
=
$@" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and hpc.
{
nameof
(
RB_Distributor_HPCategory
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and hpc.
{
nameof
(
RB_Distributor_HPCategory
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
CommissionId
>
0
)
{
where
+=
$@" and hpc.
{
nameof
(
RB_Distributor_HPCategory
.
CommissionId
)}
=
{
dmodel
.
CommissionId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CommissionIds
))
{
where
+=
$@" and hpc.
{
nameof
(
RB_Distributor_HPCategory
.
CommissionId
)}
in(
{
dmodel
.
CommissionIds
}
)"
;
}
string
sql
=
$@"select hpc.*,c.Name as CategoryName from RB_Distributor_HPCategory hpc
inner join RB_Product_Category c on hpc.CategoryId=c.Id
where
{
where
}
order by hpc.Id desc"
;
return
Get
<
RB_Distributor_HPCategory_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Distributor_HPCommissionRepository.cs
0 → 100644
View file @
a31dcc37
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System.Linq
;
namespace
Mall.Repository.User
{
/// <summary>
/// 和平分销返佣仓储层
/// </summary>
public
class
RB_Distributor_HPCommissionRepository
:
RepositoryBase
<
RB_Distributor_HPCommission
>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_HPCommission_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Distributor_HPCommission_Extend
dmodel
)
{
string
where
=
$@" 1=1 and h.
{
nameof
(
RB_Distributor_HPCommission
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
CategoryId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
=
{
dmodel
.
CategoryId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIds
))
{
where
+=
$@" and c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
in(
{
dmodel
.
CategoryIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIdsT
))
{
where
+=
$@" and (c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
in(
{
dmodel
.
CategoryIdsT
}
) or c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
=-1)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
string
sql
=
$@"select h.* from RB_Distributor_HPCommission h
left join RB_Distributor_HPCategory c on h.Id = c.CommissionId
where
{
where
}
group by h.Id order by h.Id desc"
;
return
GetPage
<
RB_Distributor_HPCommission_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_HPCommission_Extend
>
GetList
(
RB_Distributor_HPCommission_Extend
dmodel
)
{
string
where
=
$@" 1=1 and h.
{
nameof
(
RB_Distributor_HPCommission
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
CategoryId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
=
{
dmodel
.
CategoryId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIds
))
{
where
+=
$@" and c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
in(
{
dmodel
.
CategoryId
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIdsT
))
{
where
+=
$@" and (c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
in(
{
dmodel
.
CategoryIdsT
}
) or c.
{
nameof
(
RB_Distributor_HPCategory
.
CategoryId
)}
=-1)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and h.
{
nameof
(
RB_Distributor_HPCommission
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
string
sql
=
$@"select h.* from RB_Distributor_HPCommission h
left join RB_Distributor_HPCategory c on h.Id = c.CommissionId
where
{
where
}
group by h.Id order by h.Id desc"
;
return
Get
<
RB_Distributor_HPCommission_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Distributor_HPGradeInfoRepository.cs
0 → 100644
View file @
a31dcc37
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System.Linq
;
namespace
Mall.Repository.User
{
/// <summary>
/// 和平等级仓储层
/// </summary>
public
class
RB_Distributor_HPGradeInfoRepository
:
RepositoryBase
<
RB_Distributor_HPGradeInfo
>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_HPGradeInfo_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Distributor_HPGradeInfo_Extend
dmodel
)
{
string
where
=
$@" 1=1 and
{
nameof
(
RB_Distributor_HPGradeInfo
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
Grade
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
Grade
)}
=
{
dmodel
.
Grade
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GradeName
))
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
GradeName
)}
like '%
{
dmodel
.
GradeName
}
%'"
;
}
string
sql
=
$@"select * from RB_Distributor_HPGradeInfo where
{
where
}
order by Id desc"
;
return
GetPage
<
RB_Distributor_HPGradeInfo_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_HPGradeInfo_Extend
>
GetList
(
RB_Distributor_HPGradeInfo_Extend
dmodel
)
{
string
where
=
$@" 1=1 and
{
nameof
(
RB_Distributor_HPGradeInfo
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
Grade
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
Grade
)}
=
{
dmodel
.
Grade
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GradeName
))
{
where
+=
$@" and
{
nameof
(
RB_Distributor_HPGradeInfo
.
GradeName
)}
like '%
{
dmodel
.
GradeName
}
%'"
;
}
string
sql
=
$@"select * from RB_Distributor_HPGradeInfo where
{
where
}
order by Id desc"
;
return
Get
<
RB_Distributor_HPGradeInfo_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Distributor_HPGradeRatioRepository.cs
0 → 100644
View file @
a31dcc37
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System.Linq
;
namespace
Mall.Repository.User
{
/// <summary>
/// 和平分销返佣比例仓储层
/// </summary>
public
class
RB_Distributor_HPGradeRatioRepository
:
RepositoryBase
<
RB_Distributor_HPGradeRatio
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_HPGradeRatio_Extend
>
GetList
(
RB_Distributor_HPGradeRatio_Extend
dmodel
)
{
string
where
=
$@" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_HPGradeRatio
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_HPGradeRatio
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
CommissionId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_HPGradeRatio
.
CommissionId
)}
=
{
dmodel
.
CommissionId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CommissionIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_HPGradeRatio
.
CommissionId
)}
in(
{
dmodel
.
CommissionIds
}
)"
;
}
string
sql
=
$@"select r.*,g.Grade,g.GradeName from RB_Distributor_HPGradeRatio r
inner join RB_Distributor_HPGradeInfo g on r.GradeId = g.Id
where
{
where
}
order by r.Id desc"
;
return
Get
<
RB_Distributor_HPGradeRatio_Extend
>(
sql
).
ToList
();
}
}
}
Mall.WebApi/Controllers/User/UserController.cs
View file @
a31dcc37
This diff is collapsed.
Click to expand it.
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