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
b22f966d
Commit
b22f966d
authored
Aug 06, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返佣调整
parent
61ed4acc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
28 deletions
+73
-28
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+5
-5
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+67
-22
RB_Vip_BuyRepository.cs
Mall.Repository/User/RB_Vip_BuyRepository.cs
+1
-1
No files found.
Mall.Module.Product/OrderModule.cs
View file @
b22f966d
...
...
@@ -3704,9 +3704,9 @@ namespace Mall.Module.Product
int
MaxGrade
=
fxNumList
.
Max
(
x
=>
x
.
Grade
);
if
(
FXGModel
.
Grade
<
MaxGrade
)
{
//后面的全部不返佣
UserId
=
0
;
break
;
//后面的全部不返佣
2020-08-06 刘东 继续找下一级返佣
UserId
=
numodel
.
SuperiorId
??
0
;
continue
;
}
int
MaxGradeNum
=
fxNumList
.
Where
(
x
=>
x
.
Grade
==
FXGModel
.
Grade
).
Count
();
int
MaxGradeId
=
fxNumList
.
Where
(
x
=>
x
.
Grade
==
MaxGrade
).
FirstOrDefault
()?.
GradeId
??
0
;
...
...
@@ -3803,7 +3803,7 @@ namespace Mall.Module.Product
{
//后面的全部不返佣
UserId
=
0
;
break
;
numodel
=
n1umodel
;
//继续查找下一级 2020-08-06 刘东
}
else
if
(
FXG2Model
.
Grade
>
MaxGrade
)
{
...
...
@@ -4437,7 +4437,7 @@ namespace Mall.Module.Product
MallBaseId
=
demodel
.
MallBaseId
,
OrderDetailId
=
item
.
Id
,
OrderId
=
OrderId
,
Remark
=
"商品总额:"
+
(
item
.
Final_Price
??
0
)
*
(
item
.
Number
??
0
)
+
",总成本:"
+
(
item
.
CostMoney
??
0
)
*
(
item
.
Number
??
0
)
+
",总返佣:"
+
item
.
TCommissionMoney
+
",总利润:"
+
Profit
,
Remark
=
"商品总额:"
+
(
item
.
Final_Price
??
0
)
+
",总成本:"
+
(
item
.
CostMoney
??
0
)
*
(
item
.
Number
??
0
)
+
",总返佣:"
+
item
.
TCommissionMoney
+
",总利润:"
+
Profit
,
RemitStatus
=
2
,
TenantId
=
demodel
.
TenantId
,
Type
=
1
,
...
...
Mall.Module.User/UserCommonModule.cs
View file @
b22f966d
...
...
@@ -759,9 +759,9 @@ namespace Mall.Module.User
//粉象等级列表
var
VipModel
=
FXList
.
Where
(
x
=>
x
.
IsGuest
==
3
).
FirstOrDefault
();
if
(
VipModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
VipModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
var
PTModel
=
FXList
.
Where
(
x
=>
x
.
IsGuest
==
1
).
FirstOrDefault
();
if
(
PTModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
PTModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
//vip购买返佣金额列表
var
FXCList
=
distributor_FXCommissionRepository
.
GetFXCommissionList
(
new
RB_Distributor_FXCommission_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
disModel
!=
null
)
...
...
@@ -774,16 +774,39 @@ namespace Mall.Module.User
//}
//求其上级
var
pmodel
=
member_UserRepository
.
GetEntity
(
uModel
.
SuperiorId
);
if
(
pmodel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
pmodel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
var
dispModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
pmodel
.
Id
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
}).
FirstOrDefault
();
if
(
dispModel
!=
null
)
{
var
pfxModel
=
FXList
.
Where
(
x
=>
x
.
Id
==
dispModel
.
FXGradeId
).
FirstOrDefault
();
if
(
pfxModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
pfxModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
if
(
pfxModel
.
Grade
<
VipModel
.
Grade
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
//其上级不是vip 直接后面的全部不提
if
(
pmodel
.
SuperiorId
>
0
)
{
while
(
pmodel
.
SuperiorId
>
0
)
{
pmodel
=
member_UserRepository
.
GetEntity
(
pmodel
.
SuperiorId
);
if
(
pmodel
==
null
||
(
pmodel
.
SuperiorId
??
0
)
==
0
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
dispModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
pmodel
.
Id
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
}).
FirstOrDefault
();
if
(
dispModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
pfxModel
=
FXList
.
Where
(
x
=>
x
.
Id
==
dispModel
.
FXGradeId
).
FirstOrDefault
();
if
(
pfxModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
if
(
pfxModel
.
Grade
<
VipModel
.
Grade
)
{
continue
;
}
else
{
break
;
}
}
}
else
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
//vipBuyRepository.DBSession.Rollback();
//return false;//其上级不是vip 直接后面的全部不提
}
//查询出当前用户的所有上级
string
UserIds
=
member_UserRepository
.
GetMemberParentIdStr
(
pmodel
.
Id
);
...
...
@@ -858,9 +881,9 @@ namespace Mall.Module.User
int
MaxGrade
=
fxNumList
.
Max
(
x
=>
x
.
Grade
);
if
(
FXGModel
.
Grade
<
MaxGrade
)
{
//后面的全部不返佣
UserId
=
0
;
break
;
//后面的全部不返佣
2020-08-06 刘东 继续找下级
UserId
=
numodel
.
SuperiorId
??
0
;
continue
;
}
int
MaxGradeNum
=
fxNumList
.
Where
(
x
=>
x
.
Grade
==
FXGModel
.
Grade
).
Count
();
int
MaxGradeId
=
fxNumList
.
Where
(
x
=>
x
.
Grade
==
MaxGrade
).
FirstOrDefault
()?.
GradeId
??
0
;
...
...
@@ -947,7 +970,7 @@ namespace Mall.Module.User
{
//后面的全部不返佣
UserId
=
0
;
break
;
numodel
=
n1umodel
;
//继续查找下一级 2020-08-06 刘东
}
else
if
(
FXG2Model
.
Grade
>
MaxGrade
)
{
...
...
@@ -1126,13 +1149,13 @@ namespace Mall.Module.User
if
(
basicModel
.
IsEnableFXGrade
==
1
)
{
if
(
uModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
uModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
//粉象等级列表
var
FXList
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
VipModel
=
FXList
.
Where
(
x
=>
x
.
IsGuest
==
3
).
FirstOrDefault
();
if
(
VipModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
VipModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
var
PTModel
=
FXList
.
Where
(
x
=>
x
.
IsGuest
==
1
).
FirstOrDefault
();
if
(
PTModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
PTModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
//vip购买返佣金额列表
var
FXCList
=
distributor_FXCommissionRepository
.
GetFXCommissionList
(
new
RB_Distributor_FXCommission_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
disModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
BuyUserId
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
}).
FirstOrDefault
();
...
...
@@ -1140,21 +1163,43 @@ namespace Mall.Module.User
{
if
(
disModel
.
FXGradeId
!=
VipModel
.
Id
&&
disModel
.
FXGradeId
!=
PTModel
.
Id
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
//求其上级
var
pmodel
=
member_UserRepository
.
GetEntity
(
uModel
.
SuperiorId
);
if
(
pmodel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
pmodel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
var
dispModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
pmodel
.
Id
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
}).
FirstOrDefault
();
if
(
dispModel
!=
null
)
{
var
pfxModel
=
FXList
.
Where
(
x
=>
x
.
Id
==
dispModel
.
FXGradeId
).
FirstOrDefault
();
if
(
pfxModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
}
if
(
pfxModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
if
(
pfxModel
.
Grade
<
VipModel
.
Grade
)
{
vipBuyRepository
.
DBSession
.
Rollback
();
return
false
;
//其上级不是vip 直接后面的全部不提
if
(
pmodel
.
SuperiorId
>
0
)
{
while
(
pmodel
.
SuperiorId
>
0
)
{
pmodel
=
member_UserRepository
.
GetEntity
(
pmodel
.
SuperiorId
);
if
(
pmodel
==
null
||
(
pmodel
.
SuperiorId
??
0
)
==
0
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
dispModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
pmodel
.
Id
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
}).
FirstOrDefault
();
if
(
dispModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
pfxModel
=
FXList
.
Where
(
x
=>
x
.
Id
==
dispModel
.
FXGradeId
).
FirstOrDefault
();
if
(
pfxModel
==
null
)
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
if
(
pfxModel
.
Grade
<
VipModel
.
Grade
)
{
continue
;
}
else
{
break
;
}
}
}
else
{
vipBuyRepository
.
DBSession
.
Commit
();
return
false
;
}
//vipBuyRepository.DBSession.Commit();
//return false;//其上级不是vip 直接后面的全部不提
}
//查询出当前用户的所有上级
string
UserIds
=
member_UserRepository
.
GetMemberParentIdStr
(
pmodel
.
Id
);
...
...
@@ -1229,9 +1274,9 @@ namespace Mall.Module.User
int
MaxGrade
=
fxNumList
.
Max
(
x
=>
x
.
Grade
);
if
(
FXGModel
.
Grade
<
MaxGrade
)
{
//后面的全部不返佣
UserId
=
0
;
break
;
//后面的全部不返佣
2020-08-06 刘东 后面的人继续找
UserId
=
numodel
.
SuperiorId
??
0
;
continue
;
}
int
MaxGradeNum
=
fxNumList
.
Where
(
x
=>
x
.
Grade
==
FXGModel
.
Grade
).
Count
();
int
MaxGradeId
=
fxNumList
.
Where
(
x
=>
x
.
Grade
==
MaxGrade
).
FirstOrDefault
()?.
GradeId
??
0
;
...
...
@@ -1318,7 +1363,7 @@ namespace Mall.Module.User
{
//后面的全部不返佣
UserId
=
0
;
break
;
numodel
=
n1umodel
;
//继续查找下一级 2020-08-06 刘东
}
else
if
(
FXG2Model
.
Grade
>
MaxGrade
)
{
...
...
Mall.Repository/User/RB_Vip_BuyRepository.cs
View file @
b22f966d
...
...
@@ -103,7 +103,7 @@ namespace Mall.Repository.User
builder
.
Append
(
$@" SELECT a.*,b.`Name` as UserName
FROM rb_vip_buy as a
INNER JOIN rb_member_user as b on a.UserId=b.Id
INNER
JOIN rb_vipbuy_commission c on a.Id = c.OrderId
Left
JOIN rb_vipbuy_commission c on a.Id = c.OrderId
WHERE a.
{
nameof
(
RB_Vip_Buy_Extend
.
Status
)}
=0 "
);
if
(
query
!=
null
)
{
...
...
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