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
3ed4261b
Commit
3ed4261b
authored
Jun 15, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
29c176b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
193 additions
and
114 deletions
+193
-114
UserModule.cs
Mall.Module.User/UserModule.cs
+190
-111
RB_DiscountCouponRepository.cs
...Repository/MarketingCenter/RB_DiscountCouponRepository.cs
+3
-3
No files found.
Mall.Module.User/UserModule.cs
View file @
3ed4261b
...
...
@@ -124,6 +124,9 @@ namespace Mall.Module.User
/// </summary>
private
static
RB_Finance_ConfigurineRepository
financeConfigurineRepository
=
new
RB_Finance_ConfigurineRepository
();
private
Repository
.
User
.
RB_Member_CouponRepository
memberCouponRepository
=
new
Repository
.
User
.
RB_Member_CouponRepository
();
#
region
基础配置
/// <summary>
...
...
@@ -534,15 +537,18 @@ namespace Mall.Module.User
{
var
umodel
=
member_UserRepository
.
GetEntity
(
userInfo
.
UserId
);
var
gradeModel
=
member_GradeRepository
.
GetEntity
(
gradeId
);
if
(
gradeModel
==
null
)
{
if
(
gradeModel
==
null
)
{
return
"等级不存在"
;
}
if
(
gradeModel
.
IsAutoUpGrade
!=
1
)
{
if
(
gradeModel
.
IsAutoUpGrade
!=
1
)
{
return
"无法升级到该等级"
;
}
//获取用户订单金额
var
SaleModel
=
goods_OrderRepository
.
GetUserOrderNumAndMoney
(
userInfo
.
UserId
.
ToString
(),
userInfo
.
TenantId
,
userInfo
.
MallBaseId
).
FirstOrDefault
();
if
(
gradeModel
.
UpGradeMoney
>
(
SaleModel
?.
Income
??
0
))
{
if
(
gradeModel
.
UpGradeMoney
>
(
SaleModel
?.
Income
??
0
))
{
//升级条件不满足
return
"需累计完成订单金额:"
+
gradeModel
.
UpGradeMoney
;
}
...
...
@@ -562,7 +568,8 @@ namespace Mall.Module.User
{
return
""
;
}
else
{
else
{
return
"升级失败,请联系管理员"
;
}
}
...
...
@@ -592,7 +599,7 @@ namespace Mall.Module.User
//获取权益列表
qlist
=
member_EquityRepository
.
GetList
(
new
RB_Member_Equity_Extend
()
{
GradeId
=
umodel
.
MemberGrade
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
}
//获取可升级的会员信息
var
UpGradeModel
=
member_GradeRepository
.
GetMemberUpgrade
(
Grade
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
var
UpGradeInfo
=
new
object
();
...
...
@@ -613,7 +620,8 @@ namespace Mall.Module.User
UpGradeModel
.
IsMemberBuy
,
UpGradeModel
.
MemberBuyMoney
,
UpGradeModel
.
MemberSpecification
,
QList
=
qlist1
.
Select
(
x
=>
new
{
QList
=
qlist1
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Title
,
x
.
ImagePath
,
...
...
@@ -622,7 +630,8 @@ namespace Mall.Module.User
}
};
}
else
{
else
{
UpGradeInfo
=
new
{
Status
=
2
,
...
...
@@ -641,7 +650,8 @@ namespace Mall.Module.User
Icon
,
BackgroundImage
,
Discount
,
QList
=
qlist
.
Select
(
x
=>
new
{
QList
=
qlist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Title
,
x
.
ImagePath
,
...
...
@@ -675,7 +685,8 @@ namespace Mall.Module.User
OperatorEnum
=
OperatorEnum
.
Equal
}
};
if
(
demodel
.
Id
>
0
)
{
if
(
demodel
.
Id
>
0
)
{
whereHelpers
.
Add
(
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Member_Grade
.
Id
),
...
...
@@ -1365,11 +1376,13 @@ namespace Mall.Module.User
/// <returns></returns>
public
bool
SetHpUserReferralsAudit
(
int
userId
,
int
type
,
AppletUserInfo
userInfo
)
{
if
(
GetHpDistributorIsEnabled
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
)
==
2
)
{
if
(
GetHpDistributorIsEnabled
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
)
==
2
)
{
return
false
;
}
var
disModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
disModel
==
null
||
disModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Reject
)
{
if
(
disModel
==
null
||
disModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Reject
)
{
return
false
;
}
if
(
type
==
1
)
...
...
@@ -1393,7 +1406,8 @@ namespace Mall.Module.User
};
return
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Info
.
AuditStatus
),
DistributorAuditStatusEnum
.
Reject
},
{
nameof
(
RB_Distributor_Info
.
Remark
),
"上线自行审核拒绝"
},
...
...
@@ -1408,7 +1422,7 @@ namespace Mall.Module.User
};
return
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
);
}
}
/// <summary>
...
...
@@ -1665,7 +1679,8 @@ namespace Mall.Module.User
bool
flag
=
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
,
trans
);
}
}
else
if
(
type
==
6
)
{
else
if
(
type
==
6
)
{
var
list
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
userIds
,
TenantId
=
Convert
.
ToInt32
(
uid
),
MallBaseId
=
mallBaseId
});
var
ulist
=
member_UserRepository
.
GetList
(
new
RB_Member_User_Extend
()
{
UserIds
=
userIds
,
TenantId
=
Convert
.
ToInt32
(
uid
),
MallBaseId
=
mallBaseId
});
var
gmodel
=
distributor_HPGradeInfoRepository
.
GetEntity
(
newGradeId
);
...
...
@@ -1677,7 +1692,8 @@ namespace Mall.Module.User
}
//验证其上级用户
var
umodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
item
.
UserId
).
FirstOrDefault
();
if
(
umodel
==
null
)
{
if
(
umodel
==
null
)
{
return
"用户不存在ID:"
+
item
.
UserId
;
}
if
(
umodel
.
SuperiorId
==
0
)
...
...
@@ -1688,7 +1704,8 @@ namespace Mall.Module.User
return
"用户上级不存在,只能修改为1级和平分销 ID:"
+
item
.
UserId
;
}
}
else
{
else
{
if
((
gmodel
?.
Grade
??
0
)
==
1
)
{
return
"用户上级存在,无法改为1级和平分销 ID:"
+
item
.
UserId
;
...
...
@@ -1855,7 +1872,8 @@ namespace Mall.Module.User
/// </summary>
/// <param name="remitId"></param>
/// <returns></returns>
public
RB_Distributor_Remit_Extend
GetDistributorEntity
(
int
remitId
)
{
public
RB_Distributor_Remit_Extend
GetDistributorEntity
(
int
remitId
)
{
return
distributor_RemitRepository
.
GetEntity
<
RB_Distributor_Remit_Extend
>(
remitId
);
}
...
...
@@ -1882,7 +1900,7 @@ namespace Mall.Module.User
{
if
(
type
==
1
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
),
(
int
)
Common
.
Enum
.
User
.
DistributorRemitAuditStatusEnum
.
ToPlayWith
},
{
nameof
(
RB_Distributor_Remit
.
AuditDate
),
DateTime
.
Now
},
...
...
@@ -1896,7 +1914,8 @@ namespace Mall.Module.User
}
};
bool
flag
=
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//提现审核通过 自动生成财务单据
OrderIncomeFinanceModule
(
remitId
,
Convert
.
ToInt32
(
uid
),
mallBaseId
,
remark
);
}
...
...
@@ -1918,7 +1937,7 @@ namespace Mall.Module.User
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
}
else
if
(
type
==
3
)
{
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
),
(
int
)
Common
.
Enum
.
User
.
DistributorRemitAuditStatusEnum
.
Reject
},
{
nameof
(
RB_Distributor_Remit
.
RejectDate
),
DateTime
.
Now
},
...
...
@@ -1944,13 +1963,14 @@ namespace Mall.Module.User
/// 生成提现单据
/// </summary>
/// <returns></returns>
public
bool
OrderIncomeFinanceModule
(
int
remitId
,
int
TenantId
,
int
MallBaseId
,
string
remark
)
public
bool
OrderIncomeFinanceModule
(
int
remitId
,
int
TenantId
,
int
MallBaseId
,
string
remark
)
{
var
flag
=
false
;
try
{
var
remitModel
=
distributor_RemitRepository
.
GetEntity
(
remitId
);
if
(
remitModel
==
null
)
{
if
(
remitModel
==
null
)
{
return
false
;
}
decimal
Money
=
(
remitModel
.
AppliedMoney
??
0
)
-
(
remitModel
.
Fee
??
0
);
...
...
@@ -1965,7 +1985,8 @@ namespace Mall.Module.User
//根据规则中的小程序,查询订单详情信息
string
dstr
=
""
;
if
(
remitModel
.
Fee
>
0
)
{
if
(
remitModel
.
Fee
>
0
)
{
dstr
=
"申请:"
+
(
remitModel
.
AppliedMoney
??
0
)
+
"金额,手续费:"
+
(
remitModel
.
Fee
??
0
)
+
",实际打款:"
+
Money
;
}
if
(
financeConfigurineList
!=
null
&&
financeConfigurineList
.
Any
())
...
...
@@ -2022,9 +2043,10 @@ namespace Mall.Module.User
};
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
else
{
//记录自动生成失败,需手动新增财务单据
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
AuditRemark
),
remark
+
" 自动生成财务单据失败,请手动添加财务单据!"
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
...
...
@@ -2053,7 +2075,8 @@ namespace Mall.Module.User
/// <param name="remitId"></param>
/// <param name="remark"></param>
/// <returns></returns>
public
bool
SetDistributorRemitRemark
(
int
remitId
,
string
remark
)
{
public
bool
SetDistributorRemitRemark
(
int
remitId
,
string
remark
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
RemitRemark
),
remark
},
};
...
...
@@ -2152,7 +2175,7 @@ namespace Mall.Module.User
}
}
return
list
;
}
}
/// <summary>
/// 收货地址列表
...
...
@@ -2457,7 +2480,8 @@ namespace Mall.Module.User
{
var
basicsModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
bool
flag
=
true
;
if
(
basicsModel
.
DistributorCondition
==
DistributorConditionEnum
.
GMSP
)
{
if
(
basicsModel
.
DistributorCondition
==
DistributorConditionEnum
.
GMSP
)
{
//验证购买商品
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
...
...
@@ -2493,7 +2517,8 @@ namespace Mall.Module.User
};
flag
=
goods_OrderRepository
.
Exists
(
whereHelpers
);
}
else
if
(
basicsModel
.
DistributorCondition
==
DistributorConditionEnum
.
DCXF
){
else
if
(
basicsModel
.
DistributorCondition
==
DistributorConditionEnum
.
DCXF
)
{
//单次消费 充值也算 (货到付款这种怎么处理)
}
...
...
@@ -2507,7 +2532,8 @@ namespace Mall.Module.User
ApplyForName
=
basicsModel
.
ApplyFor
.
GetEnumName
()
};
}
else
{
else
{
return
new
{
Status
=
0
,
...
...
@@ -2564,13 +2590,15 @@ namespace Mall.Module.User
var
upmodel
=
member_UserRepository
.
GetEntity
(
umodel
.
SuperiorId
??
0
);
SuperiorName
=
upmodel
?.
Name
??
""
;
}
else
if
(
umodel
.
SuperiorId
==
0
&&
umodel
.
IsBeDownline
==
2
&&
umodel
.
WaitSuperiorId
>
0
)
{
else
if
(
umodel
.
SuperiorId
==
0
&&
umodel
.
IsBeDownline
==
2
&&
umodel
.
WaitSuperiorId
>
0
)
{
SuperiorId
=
umodel
.
WaitSuperiorId
??
0
;
var
upmodel
=
member_UserRepository
.
GetEntity
(
umodel
.
WaitSuperiorId
??
0
);
SuperiorName
=
upmodel
?.
Name
??
""
;
}
var
CustomModel
=
distributor_CustomRepository
.
GetList
(
new
RB_Distributor_Custom_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
CustomModel
==
null
)
{
if
(
CustomModel
==
null
)
{
return
""
;
}
return
new
...
...
@@ -2712,7 +2740,7 @@ namespace Mall.Module.User
RemitMoney
=
remitMoney
,
ReferralsNum
=
oneNum
+
twoNum
+
threeNum
}
};
};
}
/// <summary>
...
...
@@ -2723,7 +2751,8 @@ namespace Mall.Module.User
public
object
GetDistrbutorUpgradeConditions
(
AppletUserInfo
userInfo
)
{
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userInfo
.
UserId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
model
==
null
||
model
.
AuditStatus
!=
DistributorAuditStatusEnum
.
Audited
)
{
if
(
model
==
null
||
model
.
AuditStatus
!=
DistributorAuditStatusEnum
.
Audited
)
{
return
new
{
Status
=
2
,
...
...
@@ -2739,13 +2768,13 @@ namespace Mall.Module.User
Status
=
2
,
GradeInfo
=
new
{
}
};
}
}
else
{
return
new
{
{
Status
=
1
,
GradeInfo
=
new
GradeInfo
=
new
{
upgmodel
.
Id
,
upgmodel
.
Grade
,
...
...
@@ -2773,7 +2802,8 @@ namespace Mall.Module.User
/// <returns></returns>
public
string
SetUserDistrbutorUpgrade
(
int
gradeId
,
AppletUserInfo
userInfo
)
{
if
(
GetHpDistributorIsEnabled
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
)==
2
)
{
if
(
GetHpDistributorIsEnabled
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
)
==
2
)
{
return
"和平分销无法自动升级"
;
}
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userInfo
.
UserId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
...
...
@@ -2782,10 +2812,12 @@ namespace Mall.Module.User
return
"您不是分销商,无法操作"
;
}
var
gmodel
=
distributor_GradeRepository
.
GetEntity
(
gradeId
);
if
(
gmodel
==
null
)
{
if
(
gmodel
==
null
)
{
return
"该等级不存在,无法升级"
;
}
if
(
gmodel
.
IsAutoUpGrade
!=
1
)
{
if
(
gmodel
.
IsAutoUpGrade
!=
1
)
{
return
"该等级不能自动升级"
;
}
...
...
@@ -2793,25 +2825,30 @@ namespace Mall.Module.User
{
//验证下线数量
var
xxModel
=
member_UserRepository
.
GetDistributorReferralsNum
(
userInfo
.
UserId
.
ToString
(),
1
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
).
FirstOrDefault
();
if
(
xxModel
==
null
)
{
if
(
xxModel
==
null
)
{
return
"您当前下线数量为0,无法升级"
;
}
if
((
xxModel
.
ReferralsNum
??
0
)
<
(
gmodel
.
ReferralsNumber
??
0
))
{
return
"您当前下线数量为"
+
(
xxModel
.
ReferralsNum
??
0
)
+
",无法升级"
;
if
((
xxModel
.
ReferralsNum
??
0
)
<
(
gmodel
.
ReferralsNumber
??
0
))
{
return
"您当前下线数量为"
+
(
xxModel
.
ReferralsNum
??
0
)
+
",无法升级"
;
}
}
else
if
(
gmodel
.
UpGradeCondition
==
DistrbutorGradeUpdateEnum
.
LJYJ
)
{
//验证累计佣金
if
((
model
.
TotalCommission
??
0
)
<
(
gmodel
.
TotalCommission
??
0
))
{
if
((
model
.
TotalCommission
??
0
)
<
(
gmodel
.
TotalCommission
??
0
))
{
return
"您当前累计佣金为"
+
(
model
.
TotalCommission
??
0
)
+
",无法升级"
;
}
}
else
if
(
gmodel
.
UpGradeCondition
==
DistrbutorGradeUpdateEnum
.
YTXYJ
)
{
else
if
(
gmodel
.
UpGradeCondition
==
DistrbutorGradeUpdateEnum
.
YTXYJ
)
{
//验证已提现佣金
//已提现佣金 //未结算佣金
var
commModel
=
distributor_RemitRepository
.
GetDistributorCommissionStatiscs
(
userInfo
.
UserId
);
if
((
commModel
?.
TXCommission
??
0
)
<
(
gmodel
.
CommissionWithdrawn
??
0
))
{
if
((
commModel
?.
TXCommission
??
0
)
<
(
gmodel
.
CommissionWithdrawn
??
0
))
{
return
"您当前已提现佣金为"
+
(
commModel
?.
TXCommission
??
0
)
+
",无法升级"
;
}
}
...
...
@@ -2828,7 +2865,8 @@ namespace Mall.Module.User
}
};
bool
flag
=
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
return
""
;
}
return
"升级失败,请联系管理员"
;
...
...
@@ -2843,8 +2881,9 @@ namespace Mall.Module.User
var
basicsModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
var
disModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userInfo
.
UserId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
decimal
CanRemitMoney
=
-
1
;
if
(
basicsModel
.
DailyWithdrawalLimit
!=
-
1
)
{
decimal
CanRemitMoney
=
-
1
;
if
(
basicsModel
.
DailyWithdrawalLimit
!=
-
1
)
{
//获取当日所有用户提现金额
decimal
RemitMoney
=
distributor_RemitRepository
.
GetAllUserToDayRemitMoney
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
CanRemitMoney
=
(
basicsModel
.
DailyWithdrawalLimit
??
0
)
-
RemitMoney
;
...
...
@@ -2857,7 +2896,7 @@ namespace Mall.Module.User
return
new
{
disModel
.
CommissionWithdrawal
,
disModel
.
CommissionWithdrawal
,
CanRemitMoney
,
basicsModel
.
MinimumWithdrawalLimit
,
basicsModel
.
WithdrawFee
,
...
...
@@ -2876,10 +2915,11 @@ namespace Mall.Module.User
/// <returns></returns>
public
string
SetDistrbutorWithdrawDeposit
(
RB_Distributor_Remit_Extend
demodel
)
{
//验证金额
var
disModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
demodel
.
UserId
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
if
((
disModel
.
CommissionWithdrawal
??
0
)
<
(
demodel
.
AppliedMoney
??
0
))
{
if
((
disModel
.
CommissionWithdrawal
??
0
)
<
(
demodel
.
AppliedMoney
??
0
))
{
return
"账户余额不足,请刷新后再试"
;
}
var
basicsModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
...
...
@@ -2898,7 +2938,8 @@ namespace Mall.Module.User
decimal
CanRemitMoney
=
(
basicsModel
.
DailyWithdrawalLimit
??
0
)
-
RemitMoney
;
CanRemitMoney
=
CanRemitMoney
<
0
?
0
:
CanRemitMoney
;
if
(
CanRemitMoney
<
(
demodel
.
AppliedMoney
??
0
))
{
if
(
CanRemitMoney
<
(
demodel
.
AppliedMoney
??
0
))
{
return
"今日可提现余额不足"
;
}
}
...
...
@@ -2915,7 +2956,8 @@ namespace Mall.Module.User
return
"最终金额不正确"
;
}
}
else
{
else
{
demodel
.
Fee
=
0
;
demodel
.
RemitMoney
=
demodel
.
AppliedMoney
;
}
...
...
@@ -2923,7 +2965,8 @@ namespace Mall.Module.User
try
{
bool
flag
=
distributor_RemitRepository
.
Insert
(
demodel
,
trans
)
>
0
;
if
(
flag
)
{
if
(
flag
)
{
//扣除账户可提佣金
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Info
.
CommissionWithdrawal
),(
disModel
.
CommissionWithdrawal
??
0
)
-
(
demodel
.
AppliedMoney
??
0
)}
...
...
@@ -2966,7 +3009,7 @@ namespace Mall.Module.User
}
//已提现佣金 //未结算佣金
var
commModel
=
distributor_RemitRepository
.
GetDistributorCommissionStatiscs
(
userInfo
.
UserId
);
var
CustomModel
=
distributor_CustomRepository
.
GetList
(
new
RB_Distributor_Custom_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
CustomModel
==
null
)
{
...
...
@@ -2979,7 +3022,7 @@ namespace Mall.Module.User
CustomModel
=
new
{
CustomModel
.
CommissionTobePaidName
,
CustomModel
.
UserNotesName
,
CustomModel
.
UserNotesName
,
CustomModel
.
IWantToWithdrawName
,
baseModel
.
UserNotes
},
...
...
@@ -3002,17 +3045,19 @@ namespace Mall.Module.User
/// <param name="demodel"></param>
/// <returns></returns>
public
object
GetUserMyTeamPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Distributor_Info_Extend
demodel
)
{
{
var
list
=
member_UserRepository
.
GetDistributorReferralsPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
List
<
object
>
RList
=
new
List
<
object
>();
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
userIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
//获取推广人数
var
tList
=
member_UserRepository
.
GetDistributorReferralsNum
(
userIds
,
1
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
//获取消费金额 + 订单数量
var
oList
=
goods_OrderRepository
.
GetUserOrderNumAndMoney
(
userIds
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
int
tgNum
=
tList
.
Where
(
x
=>
x
.
SuperiorId
==
item
.
Id
).
FirstOrDefault
()?.
ReferralsNum
??
0
;
var
orderModel
=
oList
.
Where
(
x
=>
x
.
UserId
==
item
.
Id
).
FirstOrDefault
();
RList
.
Add
(
new
...
...
@@ -3111,7 +3156,8 @@ namespace Mall.Module.User
MallBaseId
=
userInfo
.
MallBaseId
})
>
0
;
}
else
{
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Footmark
.
CreateDate
),
DateTime
.
Now
}
};
...
...
@@ -3167,7 +3213,7 @@ namespace Mall.Module.User
#
region
个人中心
/// <summary>
/// 获取个人中心统计
...
...
@@ -3179,7 +3225,7 @@ namespace Mall.Module.User
public
object
GetAppletUserCenterStatistics
(
string
openId
)
{
var
objData
=
new
object
();
var
umodel
=
member_UserRepository
.
GetMemberUserEntityRepository
(
new
RB_Member_User_Extend
()
{
OpenId
=
openId
});
var
umodel
=
member_UserRepository
.
GetMemberUserEntityRepository
(
new
RB_Member_User_Extend
()
{
OpenId
=
openId
});
if
(
umodel
!=
null
&&
umodel
.
Id
>
0
)
{
//获取我的收藏
...
...
@@ -3213,14 +3259,16 @@ namespace Mall.Module.User
if
(
IsHpFX
==
1
)
{
//验证如果其上级为二级分销商 则无法看到分销中心
if
(
umodel
.
IsDistributor
!=
1
&&
umodel
.
SuperiorId
>
0
)
{
if
(
umodel
.
IsDistributor
!=
1
&&
umodel
.
SuperiorId
>
0
)
{
var
SdisModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
umodel
.
SuperiorId
,
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
}).
FirstOrDefault
();
if
(
SdisModel
!=
null
)
{
var
glist
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
});
int
MinId
=
glist
.
Where
(
x
=>
(
x
.
IsGuest
??
0
)
!=
1
).
Min
(
x
=>
x
.
Grade
??
0
);
var
sdisgM
=
glist
.
Where
(
x
=>
x
.
Id
==
SdisModel
.
HPGradeId
).
FirstOrDefault
();
if
(
MinId
==
(
sdisgM
?.
Grade
??
0
))
{
if
(
MinId
==
(
sdisgM
?.
Grade
??
0
))
{
IsShowDistributionCenter
=
2
;
//其上级为最后一级 和平下不能显示分销中心
}
}
...
...
@@ -3228,7 +3276,12 @@ namespace Mall.Module.User
}
#
endregion
objData
=
new
{
//获取会员优惠券信息 2020-06-15 add by :W
var
couponList
=
memberCouponRepository
.
GetAllMemberCouponPageList
(
new
RB_Member_DiscountCoupon_Extend
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
,
UseState
=
0
,
UserId
=
umodel
.
Id
});
objData
=
new
{
//昵称
nickname
=
umodel
?.
Name
??
""
,
//电话
...
...
@@ -3246,16 +3299,16 @@ namespace Mall.Module.User
//足迹
footprint
=
FootmarkNum
,
//优惠券
coupon
=
umodel
.
CouponsNum
,
coupon
=
(
couponList
!=
null
&&
couponList
.
Any
())
?
couponList
.
Count
()
:
0
,
//2020-06-15 update by :W //
umodel.CouponsNum,
//卡券
card
=
umodel
.
CardVolumeNum
,
//标识
identity
=
new
{
parent_name
,
member_level
=
umodel
.
MemberGrade
,
level_name
=
umodel
.
MemberGradeName
,
is_admin
=
0
,
member_level
=
umodel
.
MemberGrade
,
level_name
=
umodel
.
MemberGradeName
,
is_admin
=
0
,
},
MyOrder
=
new
{
...
...
@@ -3294,9 +3347,11 @@ namespace Mall.Module.User
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
appletWeChatModel
.
MiniAppId
,
appletWeChatModel
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Set
(
appletWeChatModel
.
MiniAppId
,
token
));
}
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
string
photo
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetWeiXinUserPhoto
(
token
,
item
.
OpenId
);
if
(!
string
.
IsNullOrEmpty
(
photo
))
{
if
(!
string
.
IsNullOrEmpty
(
photo
))
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_User
.
Photo
),
photo
}
};
...
...
@@ -3334,10 +3389,12 @@ namespace Mall.Module.User
data
=
Encoding
.
GetEncoding
(
"GBK"
).
GetString
(
data1
);
var
jdata
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
data
);
var
List
=
jdata
[
"list"
].
ToString
();
if
(
List
!=
""
&&
List
!=
"[]"
)
{
if
(
List
!=
""
&&
List
!=
"[]"
)
{
//根据用户名 查询一次用户列表
List
<
Model
.
Query
.
UserSuperiorImport
>
UserList
=
JsonConvert
.
DeserializeObject
<
List
<
Model
.
Query
.
UserSuperiorImport
>>(
List
);
foreach
(
var
uitem
in
UserList
)
{
foreach
(
var
uitem
in
UserList
)
{
uitem
.
nickname
=
uitem
.
nickname
.
Replace
(
"'"
,
"\""
);
uitem
.
nickname
=
uitem
.
nickname
.
Replace
(
"??"
,
"?"
);
uitem
.
nickname
=
"'"
+
uitem
.
nickname
+
"'"
;
...
...
@@ -3345,7 +3402,8 @@ namespace Mall.Module.User
string
UserNameStr
=
string
.
Join
(
","
,
UserList
.
Select
(
x
=>
x
.
nickname
));
var
uList
=
member_UserRepository
.
GetList
(
new
RB_Member_User_Extend
()
{
UserNameStr
=
UserNameStr
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
foreach
(
var
qitem
in
uList
)
{
foreach
(
var
qitem
in
uList
)
{
if
(
qitem
.
SuperiorId
==
0
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -3442,7 +3500,8 @@ namespace Mall.Module.User
};
return
distributor_HPGradeInfoRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
else
{
return
distributor_HPGradeInfoRepository
.
Insert
(
demodel
)
>
0
;
}
}
...
...
@@ -3491,14 +3550,16 @@ namespace Mall.Module.User
public
List
<
RB_Distributor_HPCommission_Extend
>
GetHpDistributorPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Distributor_HPCommission_Extend
demodel
)
{
var
list
=
distributor_HPCommissionRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
cids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
//查询所有分类
var
clist
=
distributor_HPCategoryRepository
.
GetList
(
new
RB_Distributor_HPCategory_Extend
()
{
CommissionIds
=
cids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
//查询所有比例
var
rlist
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionIds
=
cids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
item
.
CategoryList
=
clist
.
Where
(
x
=>
x
.
CommissionId
==
item
.
Id
).
ToList
();
item
.
RatioList
=
rlist
.
Where
(
x
=>
x
.
CommissionId
==
item
.
Id
).
OrderBy
(
x
=>
x
.
Grade
).
ToList
();
}
...
...
@@ -3559,14 +3620,16 @@ namespace Mall.Module.User
}
};
bool
flag
=
distributor_HPCommissionRepository
.
Update
(
keyValues
,
wheres
,
trans
);
if
(
flag
)
{
if
(
flag
)
{
#
region
验证比例是否修改
var
rlist
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
rUpdateList
=
rlist
.
Where
(
x
=>
demodel
.
RatioList
.
Select
(
z
=>
z
.
GradeId
).
Contains
(
x
.
GradeId
)).
ToList
();
var
rDelList
=
rlist
.
Where
(
x
=>
!
demodel
.
RatioList
.
Select
(
z
=>
z
.
GradeId
).
Contains
(
x
.
GradeId
)).
ToList
();
var
rInsertList
=
demodel
.
RatioList
.
Where
(
x
=>
!
rlist
.
Select
(
z
=>
z
.
GradeId
).
Contains
(
x
.
GradeId
)).
ToList
();
foreach
(
var
item
in
rUpdateList
)
{
foreach
(
var
item
in
rUpdateList
)
{
var
rmodel
=
demodel
.
RatioList
.
Where
(
x
=>
x
.
GradeId
==
item
.
GradeId
).
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_HPGradeRatio
.
CommissionRatio
),
rmodel
?.
CommissionRatio
??
0
}
...
...
@@ -3580,10 +3643,12 @@ namespace Mall.Module.User
};
distributor_HPGradeRatioRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
}
foreach
(
var
item
in
rDelList
)
{
foreach
(
var
item
in
rDelList
)
{
distributor_HPGradeRatioRepository
.
Delete
(
item
,
trans
);
}
foreach
(
var
item
in
rInsertList
)
{
foreach
(
var
item
in
rInsertList
)
{
distributor_HPGradeRatioRepository
.
Insert
(
new
RB_Distributor_HPGradeRatio
()
{
CommissionId
=
demodel
.
Id
,
...
...
@@ -3599,14 +3664,16 @@ namespace Mall.Module.User
#
region
验证分类是否修改
var
clist
=
distributor_HPCategoryRepository
.
GetList
(
new
RB_Distributor_HPCategory_Extend
()
{
CommissionId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
clist
=
distributor_HPCategoryRepository
.
GetList
(
new
RB_Distributor_HPCategory_Extend
()
{
CommissionId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
cDelList
=
clist
.
Where
(
x
=>
!
demodel
.
CategoryList
.
Select
(
z
=>
z
.
CategoryId
).
Contains
(
x
.
CategoryId
)).
ToList
();
var
cInsertList
=
demodel
.
CategoryList
.
Where
(
x
=>
!
clist
.
Select
(
z
=>
z
.
CategoryId
).
Contains
(
x
.
CategoryId
)).
ToList
();
foreach
(
var
item
in
cDelList
)
{
foreach
(
var
item
in
cDelList
)
{
distributor_HPCategoryRepository
.
Delete
(
item
);
}
foreach
(
var
item
in
cInsertList
)
{
foreach
(
var
item
in
cInsertList
)
{
distributor_HPCategoryRepository
.
Insert
(
new
RB_Distributor_HPCategory
()
{
CategoryId
=
item
.
CategoryId
,
...
...
@@ -3626,9 +3693,11 @@ namespace Mall.Module.User
else
{
int
Id
=
distributor_HPCommissionRepository
.
Insert
(
demodel
,
trans
);
if
(
Id
>
0
)
{
if
(
Id
>
0
)
{
//插入比例
foreach
(
var
item
in
demodel
.
RatioList
)
{
foreach
(
var
item
in
demodel
.
RatioList
)
{
distributor_HPGradeRatioRepository
.
Insert
(
new
RB_Distributor_HPGradeRatio
()
{
CommissionId
=
Id
,
...
...
@@ -3641,7 +3710,8 @@ namespace Mall.Module.User
},
trans
);
}
//插入分类
foreach
(
var
item
in
demodel
.
CategoryList
)
{
foreach
(
var
item
in
demodel
.
CategoryList
)
{
distributor_HPCategoryRepository
.
Insert
(
new
RB_Distributor_HPCategory
()
{
CategoryId
=
item
.
CategoryId
,
...
...
@@ -3662,7 +3732,7 @@ namespace Mall.Module.User
LogHelper
.
Write
(
ex
,
"SetHpDistributorInfo"
);
distributor_HPCommissionRepository
.
DBSession
.
Rollback
();
return
false
;
}
}
}
/// <summary>
...
...
@@ -3730,7 +3800,7 @@ namespace Mall.Module.User
}
};
return
distributor_HPCommissionRepository
.
Exists
(
wheres
)
?
1
:
2
;
}
}
/// <summary>
/// 删除分销
...
...
@@ -3776,21 +3846,24 @@ namespace Mall.Module.User
{
var
umodel
=
member_UserRepository
.
GetEntity
(
userId
);
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
model
==
null
)
{
if
(
model
==
null
)
{
return
new
{
Status
=
3
,
Msg
=
"该用户不是分销商"
};
}
if
(
model
.
AuditStatus
!=
DistributorAuditStatusEnum
.
Audited
)
{
if
(
model
.
AuditStatus
!=
DistributorAuditStatusEnum
.
Audited
)
{
return
new
{
Status
=
3
,
Msg
=
"该用户不是分销商"
};
}
if
((
model
.
HPGradeId
??
0
)
<=
0
)
{
if
((
model
.
HPGradeId
??
0
)
<=
0
)
{
return
new
{
Status
=
2
,
...
...
@@ -3840,7 +3913,8 @@ namespace Mall.Module.User
OperatorEnum
=
OperatorEnum
.
Equal
}
};
if
(!
distributor_HPCommissionRepository
.
Exists
(
wheres
))
{
if
(!
distributor_HPCommissionRepository
.
Exists
(
wheres
))
{
return
new
{
Status
=
2
,
...
...
@@ -3851,15 +3925,18 @@ namespace Mall.Module.User
List
<
RB_Distributor_HPCommission_Extend
>
hpcList
=
new
List
<
RB_Distributor_HPCommission_Extend
>();
if
(
string
.
IsNullOrEmpty
(
categoryIds
))
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
}
else
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
CategoryIds
=
categoryIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(!
hpcList
.
Any
())
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
else
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
CategoryIds
=
categoryIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(!
hpcList
.
Any
())
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
}
}
if
(
hpcList
.
Any
())
{
if
(
hpcList
.
Any
())
{
var
hpcModel
=
hpcList
.
FirstOrDefault
();
//查询直客毛利率
var
gList
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
hpcModel
.
Id
,
IsGuest
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
...
...
@@ -3930,14 +4007,14 @@ namespace Mall.Module.User
List
<
RB_Distributor_HPCommission_Extend
>
hpcList
=
new
List
<
RB_Distributor_HPCommission_Extend
>();
if
(
string
.
IsNullOrEmpty
(
categoryIds
))
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
}
else
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
CategoryIds
=
categoryIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
CategoryIds
=
categoryIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(!
hpcList
.
Any
())
{
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
IsCommon
=
1
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
}
}
if
(
hpcList
.
Any
())
...
...
@@ -3957,7 +4034,7 @@ namespace Mall.Module.User
}),
Msg
=
""
};
}
return
new
{
...
...
@@ -3991,7 +4068,8 @@ namespace Mall.Module.User
var
DisList
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
userIds
,
TenantId
=
dmodel
.
TenantId
,
MallBaseId
=
dmodel
.
MallBaseId
});
List
<
RB_Distributor_Grade_Extend
>
GradeList
=
new
List
<
RB_Distributor_Grade_Extend
>();
List
<
RB_Distributor_HPGradeInfo_Extend
>
HpGradeList
=
new
List
<
RB_Distributor_HPGradeInfo_Extend
>();
if
(
DisList
.
Any
())
{
if
(
DisList
.
Any
())
{
//获取分销商等级
if
(
HpEnabled
==
1
)
{
...
...
@@ -4018,9 +4096,9 @@ namespace Mall.Module.User
item
.
DistributorName
=
disModel
?.
Name
??
""
;
item
.
DistributorMobile
=
disModel
?.
Mobile
??
""
;
item
.
MemberGradeName
=
"默认等级"
;
if
(
HpEnabled
==
1
)
if
(
HpEnabled
==
1
)
{
if
((
disModel
?.
HPGradeId
??
0
)
>
0
)
if
((
disModel
?.
HPGradeId
??
0
)
>
0
)
{
item
.
MemberGradeName
=
HpGradeList
.
Where
(
x
=>
x
.
Id
==
(
disModel
?.
HPGradeId
??
0
)).
FirstOrDefault
()?.
GradeName
??
""
;
}
...
...
@@ -4067,7 +4145,7 @@ namespace Mall.Module.User
/// <param name="width"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
string
GetWeiXinQRCode
(
string
path
,
int
width
,
int
mallBaseId
)
public
string
GetWeiXinQRCode
(
string
path
,
int
width
,
int
mallBaseId
)
{
var
appletWeChatModel
=
miniProgramRepository
.
GetEntity
(
mallBaseId
);
string
token
=
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Get
(
appletWeChatModel
.
MiniAppId
);
...
...
@@ -4076,9 +4154,10 @@ namespace Mall.Module.User
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
appletWeChatModel
.
MiniAppId
,
appletWeChatModel
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Set
(
appletWeChatModel
.
MiniAppId
,
token
));
}
if
(!
string
.
IsNullOrEmpty
(
token
))
{
if
(!
string
.
IsNullOrEmpty
(
token
))
{
//string GetImageUrl = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + token;//获取二维码
string
GetImageUrl
=
"https://api.weixin.qq.com/wxa/getwxacode?access_token="
+
token
;
//获取小程序码
string
GetImageUrl
=
"https://api.weixin.qq.com/wxa/getwxacode?access_token="
+
token
;
//获取小程序码
var
postData
=
new
{
path
,
...
...
Mall.Repository/MarketingCenter/RB_DiscountCouponRepository.cs
View file @
3ed4261b
...
...
@@ -173,16 +173,16 @@ namespace Mall.Repository.MarketingCenter
string
sql
=
@
$" SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinConsumePrice,b.DiscountsPrice,b.MaxDiscountsPrice,b.`Describe`,a.StartDate,a.EndDate,b.ID from rb_member_discountcoupon as a
LEFT
JOIN
rb_discountcoupon
as
b
on
a
.
CouponId
=
b
.
ID
LEFT
JOIN
rb_discountcoupon_product
as
c
on
c
.
DiscountCouponId
=
b
.
ID
where
a
.
UseType
=
1
and
c
.
`
Status
`
=
0
{
where
}
{
goodsClassWhere
}
where
b
.
UseType
=
1
and
c
.
`
Status
`
=
0
{
where
}
{
goodsClassWhere
}
UNION
ALL
SELECT
a
.
ID
as
MemberCouponId
,
a
.
UserId
,
b
.
`
Name
`
,
b
.
CouponType
,
b
.
UseType
,
b
.
MinConsumePrice
,
b
.
DiscountsPrice
,
b
.
MaxDiscountsPrice
,
b
.
`
Describe
`
,
a
.
StartDate
,
a
.
EndDate
,
b
.
ID
from
rb_member_discountcoupon
as
a
LEFT
JOIN
rb_discountcoupon
as
b
on
a
.
CouponId
=
b
.
ID
LEFT
JOIN
rb_discountcoupon_product
as
c
on
c
.
DiscountCouponId
=
b
.
ID
where
a
.
UseType
=
2
and
c
.
`
Status
`
=
0
{
where
}
{
goodsWhere
}
where
b
.
UseType
=
2
and
c
.
`
Status
`
=
0
{
where
}
{
goodsWhere
}
UNION
all
SELECT
a
.
ID
as
MemberCouponId
,
a
.
UserId
,
b
.
`
Name
`
,
b
.
CouponType
,
b
.
UseType
,
b
.
MinConsumePrice
,
b
.
DiscountsPrice
,
b
.
MaxDiscountsPrice
,
b
.
`
Describe
`
,
a
.
StartDate
,
a
.
EndDate
,
b
.
ID
from
rb_member_discountcoupon
as
a
LEFT
JOIN
rb_discountcoupon
as
b
on
a
.
CouponId
=
b
.
ID
where
a
.
UseType
=
3
{
where
}
{
allWhere
}
";
where
b
.
UseType
=
3
{
where
}
{
allWhere
}
";
return
Get
<
RB_DiscountCoupon_Extend
>(
sql
).
ToList
();
}
...
...
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