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
c4c0718f
Commit
c4c0718f
authored
Jul 14, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返佣
parent
9b472457
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
195 additions
and
66 deletions
+195
-66
RB_Distributor_Basics.cs
Mall.Model/Entity/User/RB_Distributor_Basics.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+120
-64
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+2
-1
UserModule.cs
Mall.Module.User/UserModule.cs
+67
-1
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+2
-0
No files found.
Mall.Model/Entity/User/RB_Distributor_Basics.cs
View file @
c4c0718f
...
...
@@ -211,5 +211,9 @@ namespace Mall.Model.Entity.User
/// 是否必须提完所有
/// </summary>
public
int
?
IsWithdrawAll
{
get
;
set
;
}
/// <summary>
/// 是否启用粉象返佣 1是 2否
/// </summary>
public
int
?
IsEnableFXGrade
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
c4c0718f
This diff is collapsed.
Click to expand it.
Mall.Module.User/UserCommonModule.cs
View file @
c4c0718f
...
...
@@ -98,7 +98,8 @@ namespace Mall.Module.User
WithdrawWay
=
"["
+
(
int
)
Common
.
Enum
.
User
.
DistrbutorWithdrawWayEnum
.
ZDDK
+
"]"
,
IsCommissionResidue
=
2
,
HpReferralsGradeAudit
=
2
,
IsWithdrawAll
=
2
IsWithdrawAll
=
2
,
IsEnableFXGrade
=
2
})
>
0
;
}
else
...
...
Mall.Module.User/UserModule.cs
View file @
c4c0718f
...
...
@@ -900,6 +900,7 @@ namespace Mall.Module.User
{
nameof
(
RB_Distributor_Basics
.
HpReferralsGradeAudit
),
demodel
.
HpReferralsGradeAudit
},
{
nameof
(
RB_Distributor_Basics
.
IsCommissionResidue
),
demodel
.
IsCommissionResidue
},
{
nameof
(
RB_Distributor_Basics
.
IsWithdrawAll
),
demodel
.
IsWithdrawAll
},
{
nameof
(
RB_Distributor_Basics
.
IsEnableFXGrade
),
demodel
.
IsEnableFXGrade
},
};
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
...
...
@@ -4485,14 +4486,79 @@ namespace Mall.Module.User
var
list
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(
list
.
Any
())
{
var
pModel
=
list
.
Where
(
x
=>
x
.
IsGuest
==
1
).
FirstOrDefault
();
if
(
pModel
==
null
)
{
return
ApiResult
.
Failed
(
"未查询到普通会员等级"
);
}
List
<
string
>
TitleList
=
new
List
<
string
>();
TitleList
.
Add
(
"等级名称"
);
TitleList
.
Add
(
"级别标准"
);
TitleList
.
Add
(
pModel
.
GradeName
);
TitleList
.
Add
(
"间接普会"
);
foreach
(
var
item
in
list
)
{
if
(
item
.
Id
!=
pModel
.
Id
)
{
TitleList
.
Add
(
item
.
GradeName
);
}
}
List
<
object
>
ContenList
=
new
List
<
object
>();
foreach
(
var
item
in
list
)
{
List
<
string
>
itemList
=
new
List
<
string
>();
itemList
.
Add
(
item
.
GradeName
);
itemList
.
Add
((
item
.
CommissionRatio
??
0
).
ToString
()
+
"%"
);
foreach
(
var
qitem
in
list
)
{
if
(
qitem
.
Id
==
pModel
.
Id
)
{
itemList
.
Add
(
GetFXGradeRatioCommon
(
list
,
item
.
Id
,
qitem
.
Id
,
1
).
ToString
()
+
"%"
);
itemList
.
Add
(
GetFXGradeRatioCommon
(
list
,
item
.
Id
,
qitem
.
Id
,
2
).
ToString
()
+
"%"
);
}
else
{
itemList
.
Add
(
GetFXGradeRatioCommon
(
list
,
item
.
Id
,
qitem
.
Id
).
ToString
()
+
"%"
);
}
}
ContenList
.
Add
(
itemList
);
}
return
ApiResult
.
Success
();
return
ApiResult
.
Success
(
""
,
new
{
TitleList
,
ContenList
});
}
else
{
return
ApiResult
.
Failed
(
"没有数据"
);
}
}
/// <summary>
/// 获取比例
/// </summary>
/// <param name="list"></param>
/// <param name="id1"></param>
/// <param name="id2"></param>
/// <returns></returns>
private
decimal
GetFXGradeRatioCommon
(
List
<
RB_Distributor_FXGrade_Extend
>
list
,
int
id1
,
int
id2
,
int
Type
=
1
)
{
var
model1
=
list
.
Where
(
x
=>
x
.
Id
==
id1
).
FirstOrDefault
();
var
model2
=
list
.
Where
(
x
=>
x
.
Id
==
id2
).
FirstOrDefault
();
var
pModel
=
list
.
Where
(
x
=>
x
.
IsGuest
==
1
).
FirstOrDefault
();
if
(
id1
==
id2
&&
Type
==
1
)
{
return
model1
.
SiblingRatio
??
0
;
}
if
(
model2
.
Grade
>
model1
.
Grade
)
{
return
0
;
}
if
(
model1
.
Grade
>
model2
.
Grade
&&
Type
==
1
)
{
return
(
model1
.
CommissionRatio
??
0
)
-
(
model2
.
CommissionRatio
??
0
);
}
if
(
id2
==
pModel
.
Id
&&
Type
==
2
)
{
if
(
id1
==
id2
)
{
return
0
;
}
return
(
model1
.
CommissionRatio
??
0
)
-
((
pModel
.
CommissionRatio
??
0
)
+
(
pModel
.
SiblingRatio
??
0
));
}
return
0
;
}
#
endregion
#
region
ERP
查询用户返佣
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
c4c0718f
...
...
@@ -784,6 +784,7 @@ namespace Mall.WebApi.Controllers.User
demodel
.
IndexImage
??=
0
;
demodel
.
HpReferralsGradeAudit
??=
2
;
demodel
.
IsWithdrawAll
??=
2
;
demodel
.
IsEnableFXGrade
??=
2
;
demodel
.
TenantId
=
Convert
.
ToInt32
(
requestParm
.
uid
);
demodel
.
MallBaseId
=
requestParm
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
...
...
@@ -836,6 +837,7 @@ namespace Mall.WebApi.Controllers.User
model
.
IsCommissionResidue
,
model
.
HpReferralsGradeAudit
,
model
.
IsWithdrawAll
,
model
.
IsEnableFXGrade
,
UpdateDate
=
model
.
UpdateDate
.
HasValue
?
model
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
}
...
...
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