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
86fc535b
Commit
86fc535b
authored
Jul 17, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vip返佣
parent
2ad753e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
6 deletions
+43
-6
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+43
-6
No files found.
Mall.Module.User/UserCommonModule.cs
View file @
86fc535b
...
@@ -410,7 +410,7 @@ namespace Mall.Module.User
...
@@ -410,7 +410,7 @@ namespace Mall.Module.User
string
UserIds
=
member_UserRepository
.
GetMemberParentIdStr
(
pmodel
.
Id
);
string
UserIds
=
member_UserRepository
.
GetMemberParentIdStr
(
pmodel
.
Id
);
var
ulist
=
member_UserRepository
.
GetList
(
new
RB_Member_User_Extend
()
{
UserIds
=
UserIds
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
ulist
=
member_UserRepository
.
GetList
(
new
RB_Member_User_Extend
()
{
UserIds
=
UserIds
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
//查询出用户的所有分销信息
//查询出用户的所有分销信息
var
dlist
=
distributor_InfoRepository
.
GetListForSingle
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
UserIds
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
dlist
=
distributor_InfoRepository
.
GetListForSingle
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
UserIds
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
dlist
)
foreach
(
var
item
in
dlist
)
{
{
item
.
Grade
=
FXList
.
Where
(
x
=>
x
.
Id
==
item
.
FXGradeId
).
FirstOrDefault
()?.
Grade
??
0
;
item
.
Grade
=
FXList
.
Where
(
x
=>
x
.
Id
==
item
.
FXGradeId
).
FirstOrDefault
()?.
Grade
??
0
;
...
@@ -582,14 +582,51 @@ namespace Mall.Module.User
...
@@ -582,14 +582,51 @@ namespace Mall.Module.User
}
}
}
}
}
}
foreach
(
var
qitem
in
gocList
)
try
{
{
if
(
qitem
.
Commission
>
0
)
var
trans
=
vipBuy_CommissionRepository
.
DbTransaction
;
if
(
gocList
.
Any
())
{
{
vipBuy_CommissionRepository
.
Insert
(
qitem
);
string
FUserIds
=
string
.
Join
(
","
,
gocList
.
Select
(
x
=>
x
.
UserId
).
Distinct
());
//分销商增加相应的佣金
//最后再次查询分销商 便于返佣金
var
fdlist
=
distributor_InfoRepository
.
GetListForSingle
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
FUserIds
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
qitem
in
gocList
)
{
if
(
qitem
.
Commission
>
0
)
{
bool
flag
=
vipBuy_CommissionRepository
.
Insert
(
qitem
,
trans
)
>
0
;
if
(
flag
)
{
//分销商增加相应的佣金
var
numodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
qitem
.
UserId
).
FirstOrDefault
();
var
fmodel
=
fdlist
.
Where
(
x
=>
x
.
UserId
==
(
numodel
?.
Id
??
0
)).
FirstOrDefault
();
if
(
fmodel
!=
null
)
{
//分销商增加佣金
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Info
.
TotalCommission
),(
fmodel
.
TotalCommission
??
0
)+(
qitem
.
Commission
??
0
)},
{
nameof
(
RB_Distributor_Info
.
CommissionWithdrawal
),(
fmodel
.
CommissionWithdrawal
??
0
)+(
qitem
.
Commission
??
0
)},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Info
.
Id
),
FiledValue
=
fmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
,
trans
);
}
}
}
}
}
}
vipBuy_CommissionRepository
.
DBSession
.
Commit
();
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"InsertVipBuyCommission"
);
vipBuy_CommissionRepository
.
DBSession
.
Rollback
();
}
}
}
}
}
}
...
...
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