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
80a4e01b
Commit
80a4e01b
authored
May 12, 2026
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
379a692f
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
305 additions
and
79 deletions
+305
-79
UserInfo.cs
Mall.Common/API/UserInfo.cs
+5
-0
TokenHelper.cs
Mall.Common/Pay/WeChatPat/TokenHelper.cs
+2
-4
HttpHelper.cs
Mall.Common/Plugin/HttpHelper.cs
+2
-0
WeiXinHelper.cs
Mall.Common/Plugin/WeiXinHelper.cs
+32
-1
RB_Brand.cs
Mall.Model/Entity/TradePavilion/RB_Brand.cs
+5
-0
PubItem.cs
Mall.Model/Extend/Pub/PubItem.cs
+22
-0
RB_BrandClass_Extend.cs
Mall.Model/Extend/TradePavilion/RB_BrandClass_Extend.cs
+20
-1
RB_Brand_Extend.cs
Mall.Model/Extend/TradePavilion/RB_Brand_Extend.cs
+11
-0
CarrierModule.cs
Mall.Module.TradePavilion/CarrierModule.cs
+72
-28
PlugInModule.cs
Mall.Module.User/PlugInModule.cs
+20
-7
UserModule.cs
Mall.Module.User/UserModule.cs
+38
-15
RB_PlugInRepository.cs
Mall.Repository/User/RB_PlugInRepository.cs
+6
-7
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+13
-12
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+10
-0
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+33
-3
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+13
-0
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+1
-1
No files found.
Mall.Common/API/UserInfo.cs
View file @
80a4e01b
...
...
@@ -170,5 +170,10 @@ namespace Mall.Common
/// 用户UnionId
/// </summary>
public
string
UserUnoinid
{
get
;
set
;
}
/// <summary>
/// 获取电话号码
/// </summary>
public
string
PhoneNum
{
get
;
set
;
}
}
}
Mall.Common/Pay/WeChatPat/TokenHelper.cs
View file @
80a4e01b
using
Mall.WeChat.Common
;
using
Mall.Common.Pay.WeChatPat.Model
;
using
System
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json
;
using
System
;
namespace
Mall.Common.Pay.WeChatPat
{
...
...
Mall.Common/Plugin/HttpHelper.cs
View file @
80a4e01b
...
...
@@ -190,6 +190,8 @@ namespace Mall.Common.Plugin
}
}
/// <summary>
/// 把响应流转换为文本。
/// </summary>
...
...
Mall.Common/Plugin/WeiXinHelper.cs
View file @
80a4e01b
using
Newtonsoft.Json.Linq
;
using
NPOI.SS.Formula.Functions
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Xml
;
using
static
QRCoder
.
PayloadGenerator
;
namespace
Mall.Common.Plugin
{
...
...
@@ -40,7 +42,7 @@ namespace Mall.Common.Plugin
/// <param name="AppSecret"></param>
/// <param name="Code"></param>
/// <returns></returns>
public
static
MiniAppUserCache
GetWeChatOpenId
(
string
AppId
,
string
AppSecret
,
string
Code
)
public
static
MiniAppUserCache
GetWeChatOpenId
(
string
AppId
,
string
AppSecret
,
string
Code
,
string
phoneCode
=
""
,
string
access_token
=
""
)
{
MiniAppUserCache
miniAppUserCache
=
new
MiniAppUserCache
();
string
result
=
""
;
...
...
@@ -58,6 +60,33 @@ namespace Mall.Common.Plugin
{
Common
.
Plugin
.
LogHelper
.
WriteInfo
(
string
.
Format
(
"GetWeChatOpenId:AppId_{0} result_{1}"
,
AppId
,
result
));
}
if
(!
string
.
IsNullOrEmpty
(
phoneCode
)
&&
!
string
.
IsNullOrEmpty
(
access_token
))
{
//用 phoneCode 换取手机号
try
{
object
phoneMsg
=
new
{
code
=
phoneCode
};
string
phoneUrl
=
$"https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=
{
access_token
}
"
;
string
phoneResult
=
Common
.
Plugin
.
HttpHelper
.
HttpPost
(
phoneUrl
,
JsonHelper
.
Serialize
(
phoneMsg
),
contenttype
:
""
);
if
(!
string
.
IsNullOrEmpty
(
phoneResult
))
{
JObject
phoneObj
=
JObject
.
Parse
(
phoneResult
);
if
(
phoneObj
.
ContainsKey
(
"phone_info"
))
{
string
phoneInfoStr
=
phoneObj
.
GetStringValue
(
"phone_info"
);
if
(!
string
.
IsNullOrEmpty
(
phoneInfoStr
))
{
JObject
phoneInfoObj
=
JObject
.
Parse
(
phoneInfoStr
);
miniAppUserCache
.
PhoneNum
=
phoneInfoObj
.
GetStringValue
(
"phoneNumber"
);
}
}
}
}
catch
(
Exception
ex1
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex1
,
string
.
Format
(
"GetWeChatOpenId_GetPhoneNum:result={0}&&Code={1}"
,
result
,
Code
));
}
}
}
}
catch
(
Exception
ex
)
...
...
@@ -73,6 +102,8 @@ namespace Mall.Common.Plugin
/// <summary>
/// 验证OpenId是否有效
/// </summary>
...
...
Mall.Model/Entity/TradePavilion/RB_Brand.cs
View file @
80a4e01b
...
...
@@ -240,5 +240,10 @@ namespace Mall.Model.Entity.TradePavilion
/// 推荐时间
/// </summary>
public
DateTime
RecommendDate
{
get
;
set
;
}
/// <summary>
/// 分类层级Id(一级分类id,二级分类Id)
/// </summary>
public
string
MoreBrandClassId
{
get
;
set
;
}
}
}
Mall.Model/Extend/Pub/PubItem.cs
0 → 100644
View file @
80a4e01b
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.Pub
{
/// <summary>
/// 常用公共属性
/// </summary>
public
class
PubItem
{
/// <summary>
/// 编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 名称
/// </summary>
public
string
Name
{
get
;
set
;
}
}
}
Mall.Model/Extend/TradePavilion/RB_BrandClass_Extend.cs
View file @
80a4e01b
...
...
@@ -5,8 +5,27 @@ using Mall.Model.Entity.TradePavilion;
namespace
Mall.Model.Extend.TradePavilion
{
public
class
RB_BrandClass_Extend
:
RB_BrandClass
public
class
RB_BrandClass_Extend
:
RB_BrandClass
{
}
public
class
BrandClassItem
{
/// <summary>
/// 编号
/// </summary>
public
int
value
{
get
;
set
;
}
/// <summary>
/// 分类名称
/// </summary>
public
string
label
{
get
;
set
;
}
/// <summary>
/// 下级分类
/// </summary>
public
List
<
BrandClassItem
>
children
{
get
;
set
;
}
}
}
Mall.Model/Extend/TradePavilion/RB_Brand_Extend.cs
View file @
80a4e01b
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.TradePavilion
;
using
Mall.Model.Extend.Pub
;
namespace
Mall.Model.Extend.TradePavilion
{
...
...
@@ -90,5 +91,15 @@ namespace Mall.Model.Extend.TradePavilion
/// 取几天数据
/// </summary>
public
int
QTop
{
get
;
set
;
}
/// <summary>
/// 分类层级Id
/// </summary>
public
List
<
int
>
MoreBrandClassIdList
{
get
;
set
;
}
/// <summary>
/// 品牌分类
/// </summary>
public
List
<
PubItem
>
BrandClassList
{
get
;
set
;
}
}
}
Mall.Module.TradePavilion/CarrierModule.cs
View file @
80a4e01b
...
...
@@ -15,6 +15,7 @@ using Mall.Model.Extend.Product;
using
RabbitMQ.Client
;
using
Mall.Common.Enum.TradePavilion
;
using
Mall.Model.Query
;
using
Mall.Model.Extend.User
;
namespace
Mall.Module.TradePavilion
{
...
...
@@ -673,49 +674,56 @@ namespace Mall.Module.TradePavilion
public
List
<
RB_Brand_Extend
>
GetBrandPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Brand_Extend
query
,
bool
IsSelectUser
=
false
)
{
var
list
=
brandRepository
.
GetBrandPageList
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
IsSelectUser
)
{
if
(
list
.
Where
(
x
=>
x
.
UserId
>
0
).
Any
())
List
<
RB_Member_User_Extend
>
ulist
=
new
List
<
RB_Member_User_Extend
>();
if
(
list
!=
null
&&
list
.
Any
())
//绑定奖章
{
//查询用户列表
string
userIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
UserId
>
0
).
Select
(
x
=>
x
.
UserId
));
var
ulist
=
member_UserRepository
.
GetList
(
new
Model
.
Extend
.
User
.
RB_Member_User_Extend
()
{
MallBaseId
=
query
.
MallBaseId
,
UserIds
=
userIds
});
foreach
(
var
item
in
list
.
Where
(
x
=>
x
.
UserId
>
0
))
if
(
IsSelectUser
&&!
string
.
IsNullOrEmpty
(
userIds
))
{
var
umodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
item
.
UserId
).
FirstOrDefault
();
item
.
UserName
=
umodel
.
Name
;
item
.
UserIcon
=
umodel
.
Photo
;
}
ulist
=
member_UserRepository
.
GetList
(
new
Model
.
Extend
.
User
.
RB_Member_User_Extend
()
{
MallBaseId
=
query
.
MallBaseId
,
UserIds
=
userIds
});
}
}
if
(
list
!=
null
&&
list
.
Any
())
//绑定奖章
{
var
brandClassList
=
GetBrandClassListModule
(
new
RB_BrandClass_Extend
()
{
BrandCategory
=
BrandCategoryEnum
.
ConsumerBrand
,
TenantId
=
query
.
TenantId
,
MallBaseId
=
query
.
MallBaseId
});
string
sourceIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
!
string
.
IsNullOrWhiteSpace
(
x
.
SourceIds
)).
Select
(
x
=>
x
.
SourceIds
));
List
<
RB_Prize_Extend
>
prizeList
=
new
List
<
RB_Prize_Extend
>();
if
(!
string
.
IsNullOrWhiteSpace
(
sourceIds
))
{
prizeList
=
prizeRepository
.
GetList
(
new
RB_Prize_Extend
{
MallBaseId
=
query
.
MallBaseId
,
TenantId
=
query
.
TenantId
,
QPrizeIds
=
sourceIds
});
}
if
(
prizeList
!=
null
&&
prizeList
.
Any
())
{
foreach
(
var
item
in
list
.
Where
(
x
=>
!
string
.
IsNullOrWhiteSpace
(
x
.
SourceIds
)))
foreach
(
var
item
in
list
)
{
item
.
PrizeList
=
new
List
<
RB_Prize_Extend
>();
foreach
(
var
itemSourceId
in
item
.
SourceIds
.
Split
(
","
))
item
.
BrandClassList
=
new
List
<
Model
.
Extend
.
Pub
.
PubItem
>();
if
(
item
.
UserId
>
0
)
{
var
umodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
item
.
UserId
).
FirstOrDefault
();
item
.
UserName
=
umodel
.
Name
;
item
.
UserIcon
=
umodel
.
Photo
;
}
var
tempSourceList
=
Common
.
ConvertHelper
.
StringToList
(
item
.
SourceIds
);
foreach
(
var
itemSourceId
in
tempSourceList
)
{
var
nowPrizeModel
=
prizeList
.
Where
(
x
=>
x
.
Id
.
ToString
()
==
itemSourceId
).
FirstOrDefault
();
var
nowPrizeModel
=
prizeList
.
Where
(
x
=>
x
.
Id
==
itemSourceId
).
FirstOrDefault
();
if
(
nowPrizeModel
!=
null
&&
nowPrizeModel
.
Id
>
0
)
{
item
.
PrizeList
.
Add
(
nowPrizeModel
);
}
}
List
<
string
>
brandClassNameList
=
new
List
<
string
>();
var
brandTypeList
=
Common
.
ConvertHelper
.
StringToList
(
item
.
MoreBrandClassId
);
foreach
(
var
subItem
in
brandTypeList
)
{
var
tempBrandClass
=
brandClassList
?.
FirstOrDefault
(
qitem
=>
qitem
.
ID
==
subItem
);
if
(
tempBrandClass
!=
null
&&
tempBrandClass
.
ID
>
0
)
{
item
.
BrandClassList
.
Add
(
new
Model
.
Extend
.
Pub
.
PubItem
()
{
Id
=
tempBrandClass
.
ID
,
Name
=
tempBrandClass
.
ClassName
});
}
}
}
}
return
list
;
}
...
...
@@ -846,7 +854,8 @@ namespace Mall.Module.TradePavilion
{
nameof
(
RB_Brand_Extend
.
OpenShopWish
),
model
.
OpenShopWish
},
{
nameof
(
RB_Brand_Extend
.
IsInChengdu
),
model
.
IsInChengdu
},
{
nameof
(
RB_Brand_Extend
.
ContactName
),
model
.
ContactName
},
{
nameof
(
RB_Brand_Extend
.
ContactPhone
),
model
.
ContactPhone
}
{
nameof
(
RB_Brand_Extend
.
ContactPhone
),
model
.
ContactPhone
},
{
nameof
(
RB_Brand_Extend
.
MoreBrandClassId
),
model
.
MoreBrandClassId
}
};
return
brandRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Brand_Extend
.
ID
),
model
.
ID
));
}
...
...
@@ -1104,6 +1113,41 @@ namespace Mall.Module.TradePavilion
return
brandClassRepository
.
GetBrandClassListRepository
(
query
);
}
/// <summary>
/// 获取品牌分类树形结构
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
BrandClassItem
>
GetBrandClassTreeModule
(
RB_BrandClass_Extend
query
)
{
List
<
BrandClassItem
>
brandClassList
=
new
List
<
BrandClassItem
>();
var
list
=
brandClassRepository
.
GetBrandClassListRepository
(
query
);
var
rootList
=
list
.
Where
(
qitem
=>
qitem
.
ParentId
==
0
)?.
OrderBy
(
qitem
=>
qitem
.
SortNum
)?.
ToList
()
??
new
List
<
RB_BrandClass_Extend
>();
foreach
(
var
rootItem
in
rootList
)
{
BrandClassItem
rootModel
=
new
BrandClassItem
()
{
value
=
rootItem
.
ID
,
label
=
rootItem
.
ClassName
,
};
var
subList
=
list
.
Where
(
qitem
=>
qitem
.
ParentId
==
rootItem
.
ID
)?.
OrderBy
(
qitem
=>
qitem
.
SortNum
)?.
ToList
()
??
new
List
<
RB_BrandClass_Extend
>();
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
{
rootModel
.
children
=
new
List
<
BrandClassItem
>();
foreach
(
var
subItem
in
subList
)
{
rootModel
.
children
.
Add
(
new
BrandClassItem
()
{
value
=
subItem
.
ID
,
label
=
subItem
.
ClassName
,
});
}
}
brandClassList
.
Add
(
rootModel
);
}
return
brandClassList
;
}
/// <summary>
/// 获取商载通链接
/// </summary>
...
...
Mall.Module.User/PlugInModule.cs
View file @
80a4e01b
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
Mall.Repository
;
using
System.Collections.Generic
;
using
System.Linq
;
using
VT.FW.DB
;
...
...
@@ -62,10 +60,25 @@ namespace Mall.Module.User
}
else
{
var
newId
=
plugInRepository
.
Insert
(
model
);
try
{
var
newModel
=
new
RB_PlugIn
()
{
Id
=
model
.
Id
,
Icon
=
model
.
Icon
,
Name
=
model
.
Name
,
PlugType
=
model
.
PlugType
,
Status
=
0
,
};
var
newId
=
plugInRepository
.
Insert
(
newModel
);
model
.
PlugId
=
newId
;
flag
=
newId
>
0
;
}
catch
{
}
}
return
flag
;
}
...
...
Mall.Module.User/UserModule.cs
View file @
80a4e01b
...
...
@@ -340,7 +340,33 @@ namespace Mall.Module.User
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Member_User
.
Id
),
FiledValue
=
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
member_UserRepository
.
Update
(
fileds
,
wheres
);
return
flag
;
}
/// <summary>
/// 更新用户电话
/// </summary>
/// <param name="Mobile"></param>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
UpdateMemberUserMobile
(
string
Mobile
,
int
Id
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_User_Extend
.
Moblie
),
Mobile
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Member_User
.
Id
),
FiledValue
=
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
...
...
@@ -406,9 +432,6 @@ namespace Mall.Module.User
return
list
;
}
/// <summary>
///根据昵称ID手机号码 获取列表
/// </summary>
...
...
@@ -419,11 +442,6 @@ namespace Mall.Module.User
return
member_UserRepository
.
GetListByPhoneOrAliasName
(
dmodel
);
}
/// <summary>
/// 分页列表
/// </summary>
...
...
@@ -478,7 +496,8 @@ namespace Mall.Module.User
/// <returns></returns>
public
bool
SetMemberUserInfoForHT
(
RB_Member_User_Extend
demodel
)
{
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_User
.
MemberGrade
),
demodel
.
MemberGrade
},
{
nameof
(
RB_Member_User
.
SuperiorId
),
demodel
.
SuperiorId
},
{
nameof
(
RB_Member_User
.
ContactWay
),
demodel
.
ContactWay
},
...
...
@@ -488,9 +507,12 @@ namespace Mall.Module.User
{
nameof
(
RB_Member_User
.
PostId
),
demodel
.
PostId
},
{
nameof
(
RB_Member_User
.
Blacklist
),
demodel
.
Blacklist
},
{
nameof
(
RB_Member_User
.
IsAdmin
),
demodel
.
IsAdmin
},
{
nameof
(
RB_Member_User
.
Moblie
),
demodel
.
Moblie
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Member_User
.
Id
),
FiledValue
=
demodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
...
...
@@ -723,7 +745,8 @@ namespace Mall.Module.User
{
nameof
(
RB_Member_User
.
Remark
),
umodel
.
Remark
+
" 客人自行升级会员等级:"
+
gradeModel
.
Name
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Member_User
.
Id
),
FiledValue
=
umodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
...
...
Mall.Repository/User/RB_PlugInRepository.cs
View file @
80a4e01b
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Mall.Repository.User
...
...
@@ -11,7 +10,7 @@ namespace Mall.Repository.User
/// <summary>
/// 插件表仓储层
/// </summary>
public
class
RB_PlugInRepository
:
BaseRepository
<
RB_PlugIn
>
public
class
RB_PlugInRepository
:
BaseRepository
<
RB_PlugIn
>
{
/// <summary>
/// 根据查询条件获取插件列表
...
...
@@ -47,7 +46,7 @@ WHERE 1=1 AND A.Status=0 ");
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_PlugIn_Extend
>
GetPlugInPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_PlugIn_Extend
query
)
public
List
<
RB_PlugIn_Extend
>
GetPlugInPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_PlugIn_Extend
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
...
...
@@ -76,7 +75,7 @@ WHERE 1=1 AND A.Status=0 ");
builder
.
AppendFormat
(
@" AND {0} IN({1}) "
,
nameof
(
RB_PlugIn_Extend
.
PlugType
),
query
.
QPlugTypeStr
);
}
}
return
GetPage
<
RB_PlugIn_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
return
GetPage
<
RB_PlugIn_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
80a4e01b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Dnc.Api.Throttle
;
using
Dnc.Api.Throttle
;
using
Mall.CacheManager.AppletWeChat
;
using
Mall.CacheManager.User
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Model.Extend.MarketingCenter
;
using
Mall.Model.Extend.User
;
using
Mall.Module.BaseSetUp
;
using
Mall.Module.MarketingCenter
;
using
Mall.Module.Product
;
using
Mall.Module.User
;
...
...
@@ -21,8 +13,10 @@ using Mall.WebApi.Filter;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
Mall.WebApi.Controllers.MallBase
...
...
@@ -724,13 +718,20 @@ namespace Mall.WebApi.Controllers.MallBase
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
string
code
=
parms
.
GetStringValue
(
"Code"
);
string
phoneCode
=
parms
.
GetStringValue
(
"phoneCode"
);
MiniAppUserCache
miniAppUserCache
=
new
MiniAppUserCache
();
if
(
RequestParm
.
MiniAppId
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
RequestParm
.
MiniAppId
))
{
var
miniProgram
=
programModule
.
GetMiniProgramModule
(
new
Model
.
Extend
.
User
.
RB_MiniProgram_Extend
()
{
MiniAppId
=
RequestParm
.
MiniAppId
});
if
(
miniProgram
!=
null
&&
miniProgram
.
MallBaseId
>
0
)
{
miniAppUserCache
=
Common
.
Plugin
.
WeiXinHelper
.
GetWeChatOpenId
(
miniProgram
.
MiniAppId
,
miniProgram
.
MiniAppSecret
,
code
);
string
token
=
WeiXinReidsCache
.
Get
(
RequestParm
.
MiniAppId
);
if
(
string
.
IsNullOrEmpty
(
token
))
{
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
RequestParm
.
MiniAppId
,
miniProgram
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
WeiXinReidsCache
.
Set
(
RequestParm
.
MiniAppId
,
token
));
}
miniAppUserCache
=
Common
.
Plugin
.
WeiXinHelper
.
GetWeChatOpenId
(
miniProgram
.
MiniAppId
,
miniProgram
.
MiniAppSecret
,
code
,
phoneCode
,
token
);
}
}
var
newGuid
=
"MiniAppOpenId_"
+
Guid
.
NewGuid
().
ToString
();
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
80a4e01b
...
...
@@ -1821,6 +1821,16 @@ namespace Mall.WebApi.Controllers
data
=
activityDataList
};
break
;
//首店首页数据组件
case
"tradeIndex"
:
var
tradeIndexData
=
subItem
.
data
as
educationCustomItem
;
obj
=
new
{
id
=
subItem
.
Id
,
data
=
tradeIndexData
};
break
;
}
return
obj
;
}
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
80a4e01b
...
...
@@ -1854,6 +1854,26 @@ namespace Mall.WebApi.Controllers.TradePavilion
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 获取品牌分类分页列表
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
public
ApiResult
GetBrandClassTree
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
query
=
new
RB_BrandClass_Extend
{
MallBaseId
=
RequestParm
.
MallBaseId
,
TenantId
=
RequestParm
.
TenantId
,
BrandCategory
=
(
BrandCategoryEnum
)
parms
.
GetInt
(
"BrandCategory"
),
};
List
<
object
>
list
=
new
List
<
object
>();
var
dataList
=
carrierModule
.
GetBrandClassTreeModule
(
query
);
return
ApiResult
.
Success
(
data
:
dataList
);
}
/// <summary>
/// 获取品牌分类实体
/// </summary>
...
...
@@ -1954,6 +1974,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
List
<
object
>
list
=
new
List
<
object
>();
var
dataList
=
carrierModule
.
GetBrandPageList
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
query
,
true
);
foreach
(
var
item
in
dataList
)
{
...
...
@@ -1984,7 +2005,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
item
.
ContactPhone
,
item
.
UserName
,
item
.
IsRecommend
,
RecommendDate
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
RecommendDate
)
RecommendDate
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
RecommendDate
),
item
.
BrandClassList
,
});
}
pageModel
.
count
=
Convert
.
ToInt32
(
rowsCount
);
...
...
@@ -2015,7 +2037,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
query
.
PaiYan
=
-
1
;
query
.
Sewage
=
-
1
;
var
extModel
=
carrierModule
.
GetBrand
(
query
);
extModel
.
MoreBrandClassIdList
=
Common
.
ConvertHelper
.
StringToList
(
extModel
.
MoreBrandClassId
);
if
(!
string
.
IsNullOrWhiteSpace
(
extModel
.
Banner
))
{
extModel
.
BannerList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
extModel
.
Banner
);
...
...
@@ -2061,6 +2083,14 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
query
.
Banner
=
""
;
}
if
(
query
.
MoreBrandClassIdList
!=
null
&&
query
.
MoreBrandClassIdList
.
Count
>
0
)
{
query
.
MoreBrandClassId
=
string
.
Join
(
","
,
query
.
MoreBrandClassIdList
);
}
else
{
query
.
MoreBrandClassId
=
""
;
}
if
(
query
.
ID
==
0
)
{
query
.
CreateDate
=
System
.
DateTime
.
Now
;
...
...
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
80a4e01b
...
...
@@ -144,6 +144,10 @@ namespace Mall.WebApi.Controllers.User
UserReidsCache
.
DeleteMiniAppUsetOpenId
(
demodel
.
OpenId
);
demodel
.
OpenId
=
opcache
.
UserOpenId
;
demodel
.
Unoinid
=
opcache
.
UserUnoinid
;
if
(!
string
.
IsNullOrEmpty
(
opcache
.
PhoneNum
)
&&
string
.
IsNullOrEmpty
(
demodel
.
Moblie
))
{
demodel
.
Moblie
=
opcache
.
PhoneNum
;
}
}
else
{
...
...
@@ -268,6 +272,7 @@ namespace Mall.WebApi.Controllers.User
isGiveCoupon
=
true
;
}
}
#
region
粉象返佣
自动注册分销商
普通会员等级
if
((
basicsModel
?.
IsEnableFXGrade
??
2
)
==
1
)
{
...
...
@@ -282,8 +287,10 @@ namespace Mall.WebApi.Controllers.User
}
}
#
endregion
//返回基本信息
TokenUserInfo
userInfo
=
new
TokenUserInfo
{
uid
=
UserId
.
ToString
(),
requestFrom
=
ApiRequestFromEnum
.
MiniProgram
};
#
region
生成
Token
string
token
=
ApiTokenHelper
.
CreateToken
(
userInfo
);
#
endregion
...
...
@@ -378,6 +385,12 @@ namespace Mall.WebApi.Controllers.User
{
userModule
.
UpdateMemberUserUnionId
(
demodel
.
Unoinid
,
umodel
.
Id
);
}
//更新用户手机号码
if
(
demodel
.
Moblie
!=
umodel
.
Moblie
&&
!
string
.
IsNullOrEmpty
(
demodel
.
Moblie
))
{
userModule
.
UpdateMemberUserMobile
(
demodel
.
Moblie
,
umodel
.
Id
);
}
//自动发放新人优惠券 2020-12-31 Add By:W
if
(
demodel
.
CounponPassword
==
5
&&
!
string
.
IsNullOrWhiteSpace
(
demodel
.
KeyWord
))
{
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
80a4e01b
...
...
@@ -105,7 +105,7 @@ namespace Mall.WebApi.Controllers.User
x
.
PostId
,
PostName
=
(
x
?.
PostId
??
0
)
==
1
?
"领队导游"
:
""
,
UserPageTypeStr
=
x
.
UserPageType
.
GetEnumName
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
});
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
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