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
3ef2aba9
Commit
3ef2aba9
authored
Mar 06, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
334e1e57
074fe5bf
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
317 additions
and
124 deletions
+317
-124
StringHelper.cs
Mall.Common/Plugin/StringHelper.cs
+52
-0
RB_Miniprogram_Template_Extend.cs
.../Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
+14
-0
RB_MiAi_BaseInfo_Extend.cs
Mall.Model/Extend/Miai/RB_MiAi_BaseInfo_Extend.cs
+11
-0
RB_Miai_ActivityEnroll_Extend.cs
Mall.Model/Extend/Miai/RB_Miai_ActivityEnroll_Extend.cs
+10
-0
MiniprogramTemplateModule.cs
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
+11
-8
MiaiModule.cs
Mall.Module.Miai/MiaiModule.cs
+46
-15
RB_MiAi_BaseInfoRepository.cs
Mall.Repository/Miai/RB_MiAi_BaseInfoRepository.cs
+6
-1
RB_MiAi_FollowMemberRepository.cs
Mall.Repository/Miai/RB_MiAi_FollowMemberRepository.cs
+1
-1
RB_Miai_ActivityDiscussRepository.cs
Mall.Repository/Miai/RB_Miai_ActivityDiscussRepository.cs
+27
-12
RB_Miai_ActivityEnrollRepository.cs
Mall.Repository/Miai/RB_Miai_ActivityEnrollRepository.cs
+4
-0
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+3
-1
AppletMiaiController.cs
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
+76
-86
MiaiController.cs
Mall.WebApi/Controllers/Miai/MiaiController.cs
+56
-0
No files found.
Mall.Common/Plugin/StringHelper.cs
View file @
3ef2aba9
...
@@ -52,6 +52,58 @@ namespace Mall.Common.Plugin
...
@@ -52,6 +52,58 @@ namespace Mall.Common.Plugin
#
region
"日期相关"
#
region
"日期相关"
/// <summary>
/// 生肖
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
static
string
GetShengXiao
(
DateTime
birthday
)
{
System
.
Globalization
.
ChineseLunisolarCalendar
chinseCaleander
=
new
System
.
Globalization
.
ChineseLunisolarCalendar
();
string
TreeYear
=
"鼠牛虎兔龙蛇马羊猴鸡狗猪"
;
int
intYear
=
chinseCaleander
.
GetSexagenaryYear
(
birthday
);
string
Tree
=
TreeYear
.
Substring
(
chinseCaleander
.
GetTerrestrialBranch
(
intYear
)
-
1
,
1
);
return
Tree
;
}
/// <summary>
/// 获取星座
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
static
string
GetAtomFromBirthday
(
DateTime
birthday
)
{
float
birthdayF
=
0.00F
;
if
(
birthday
.
Month
==
1
&&
birthday
.
Day
<
20
)
{
birthdayF
=
float
.
Parse
(
string
.
Format
(
"13.{0}"
,
birthday
.
Day
));
}
else
{
birthdayF
=
float
.
Parse
(
string
.
Format
(
"{0}.{1}"
,
birthday
.
Month
,
birthday
.
Day
));
}
float
[]
atomBound
=
{
1.20F
,
2.20F
,
3.21F
,
4.21F
,
5.21F
,
6.22F
,
7.23F
,
8.23F
,
9.23F
,
10.23F
,
11.21F
,
12.22F
,
13.20F
};
string
[]
atoms
=
{
"水瓶座"
,
"双鱼座"
,
"白羊座"
,
"金牛座"
,
"双子座"
,
"巨蟹座"
,
"狮子座"
,
"处女座"
,
"天秤座"
,
"天蝎座"
,
"射手座"
,
"魔羯座"
};
string
ret
=
"靠!外星人啊。"
;
for
(
int
i
=
0
;
i
<
atomBound
.
Length
-
1
;
i
++)
{
if
(
atomBound
[
i
]
<=
birthdayF
&&
atomBound
[
i
+
1
]
>
birthdayF
)
{
ret
=
atoms
[
i
];
break
;
}
}
return
ret
;
}
/// <summary>
/// <summary>
/// 年龄
/// 年龄
/// </summary>
/// </summary>
...
...
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
View file @
3ef2aba9
...
@@ -3033,6 +3033,20 @@ namespace Mall.Model.Extend.MarketingCenter
...
@@ -3033,6 +3033,20 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary>
/// </summary>
public
int
addUserType
{
get
;
set
;
}
public
int
addUserType
{
get
;
set
;
}
/// <summary>
/// 浏览权重
/// </summary>
public
decimal
BrowseRate
{
get
;
set
;
}
/// <summary>
/// 关注权重
/// </summary>
public
decimal
FollowRate
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 背景颜色
/// 背景颜色
/// </summary>
/// </summary>
...
...
Mall.Model/Extend/Miai/RB_MiAi_BaseInfo_Extend.cs
View file @
3ef2aba9
...
@@ -29,5 +29,16 @@ namespace Mall.Model.Extend.Miai
...
@@ -29,5 +29,16 @@ namespace Mall.Model.Extend.Miai
/// 0-指定用户,1-按照匹配度,2-按照热度,3-按照最新
/// 0-指定用户,1-按照匹配度,2-按照热度,3-按照最新
/// </summary>
/// </summary>
public
int
Sort
{
get
;
set
;
}
public
int
Sort
{
get
;
set
;
}
/// <summary>
/// 浏览权重
/// </summary>
public
decimal
BrowseRate
{
get
;
set
;
}
/// <summary>
/// 关注权重
/// </summary>
public
decimal
FollowRate
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Miai/RB_Miai_ActivityEnroll_Extend.cs
View file @
3ef2aba9
...
@@ -42,5 +42,15 @@ namespace Mall.Model.Extend.Miai
...
@@ -42,5 +42,15 @@ namespace Mall.Model.Extend.Miai
/// 活动
/// 活动
/// </summary>
/// </summary>
public
RB_Miai_Activity_Extend
ActivityModel
{
get
;
set
;
}
public
RB_Miai_Activity_Extend
ActivityModel
{
get
;
set
;
}
/// <summary>
/// 我关注的id
/// </summary>
public
int
MyFollowId
{
get
;
set
;
}
/// <summary>
/// 关注我的id
/// </summary>
public
int
OtherFollowId
{
get
;
set
;
}
}
}
}
}
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
View file @
3ef2aba9
...
@@ -152,15 +152,15 @@ namespace Mall.Module.MarketingCenter
...
@@ -152,15 +152,15 @@ namespace Mall.Module.MarketingCenter
nModel
.
background
=
(
nObj
[
"background"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"background"
].
ToString
()))
?
nObj
[
"background"
].
ToString
()
:
"#f67f79"
;
nModel
.
background
=
(
nObj
[
"background"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"background"
].
ToString
()))
?
nObj
[
"background"
].
ToString
()
:
"#f67f79"
;
nModel
.
headerUrl
=
(
nObj
[
"headerUrl"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"headerUrl"
].
ToString
()))
?
nObj
[
"headerUrl"
].
ToString
()
:
""
;
nModel
.
headerUrl
=
(
nObj
[
"headerUrl"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"headerUrl"
].
ToString
()))
?
nObj
[
"headerUrl"
].
ToString
()
:
""
;
nModel
.
btnColor
=
(
nObj
[
"btnColor"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnColor"
].
ToString
()))
?
nObj
[
"btnColor"
].
ToString
()
:
"#ff4544"
;
nModel
.
btnColor
=
(
nObj
[
"btnColor"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnColor"
].
ToString
()))
?
nObj
[
"btnColor"
].
ToString
()
:
"#ff4544"
;
Int32
.
TryParse
(
nObj
[
"btnWidth"
].
ToString
(),
out
int
btnWidth
);
Int32
.
TryParse
(
nObj
[
"btnWidth"
].
ToString
(),
out
int
btnWidth
);
nModel
.
btnWidth
=
btnWidth
>
0
?
btnWidth
:
500
;
nModel
.
btnWidth
=
btnWidth
>
0
?
btnWidth
:
500
;
Int32
.
TryParse
(
nObj
[
"btnHeight"
].
ToString
(),
out
int
btnHeight
);
Int32
.
TryParse
(
nObj
[
"btnHeight"
].
ToString
(),
out
int
btnHeight
);
nModel
.
btnHeight
=
btnHeight
>
0
?
btnHeight
:
80
;
nModel
.
btnHeight
=
btnHeight
>
0
?
btnHeight
:
80
;
Int32
.
TryParse
(
nObj
[
"btnRadius"
].
ToString
(),
out
int
btnRadius
);
Int32
.
TryParse
(
nObj
[
"btnRadius"
].
ToString
(),
out
int
btnRadius
);
nModel
.
btnRadius
=
btnRadius
>
0
?
btnRadius
:
40
;
nModel
.
btnRadius
=
btnRadius
>
0
?
btnRadius
:
40
;
nModel
.
btnText
=
(
nObj
[
"btnText"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnText"
].
ToString
()))
?
nObj
[
"btnText"
].
ToString
()
:
"我知道了"
;
nModel
.
btnText
=
(
nObj
[
"btnText"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnText"
].
ToString
()))
?
nObj
[
"btnText"
].
ToString
()
:
"我知道了"
;
nModel
.
btnTextColor
=
(
nObj
[
"btnTextColor"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnTextColor"
].
ToString
()))
?
nObj
[
"btnTextColor"
].
ToString
()
:
"#ffffff"
;
nModel
.
btnTextColor
=
(
nObj
[
"btnTextColor"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
nObj
[
"btnTextColor"
].
ToString
()))
?
nObj
[
"btnTextColor"
].
ToString
()
:
"#ffffff"
;
...
@@ -399,13 +399,14 @@ namespace Mall.Module.MarketingCenter
...
@@ -399,13 +399,14 @@ namespace Mall.Module.MarketingCenter
//图文插件
//图文插件
case
"image-text"
:
case
"image-text"
:
imagetextItem
imageItem
=
new
imagetextItem
();
imagetextItem
imageItem
=
new
imagetextItem
();
try
{
try
{
var
imgData
=
JsonHelper
.
DeserializeObject
<
imagetextItem
>(
item
.
data
.
ToString
());
var
imgData
=
JsonHelper
.
DeserializeObject
<
imagetextItem
>(
item
.
data
.
ToString
());
imageItem
.
content
=
imgData
.
content
.
Replace
(
'”'
,
'"'
).
Replace
(
"”/"
,
@""""
);
imageItem
.
content
=
imgData
.
content
.
Replace
(
'”'
,
'"'
).
Replace
(
"”/"
,
@""""
);
}
}
catch
catch
{
{
}
}
item
.
data
=
imageItem
;
item
.
data
=
imageItem
;
break
;
break
;
...
@@ -593,7 +594,7 @@ namespace Mall.Module.MarketingCenter
...
@@ -593,7 +594,7 @@ namespace Mall.Module.MarketingCenter
educationTeacherModel
.
TeacherList
=
driveData
.
TeacherList
;
educationTeacherModel
.
TeacherList
=
driveData
.
TeacherList
;
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"AnalyzePlusModule_educationteacher"
);
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"AnalyzePlusModule_educationteacher"
);
}
}
...
@@ -636,6 +637,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -636,6 +637,8 @@ namespace Mall.Module.MarketingCenter
miaiUserItem
.
PaddingLeft
=
driveData
?.
PaddingLeft
??
"0"
;
miaiUserItem
.
PaddingLeft
=
driveData
?.
PaddingLeft
??
"0"
;
miaiUserItem
.
PaddingRight
=
driveData
?.
PaddingRight
??
"0"
;
miaiUserItem
.
PaddingRight
=
driveData
?.
PaddingRight
??
"0"
;
miaiUserItem
.
SearchFilletPX
=
driveData
?.
SearchFilletPX
??
0
;
miaiUserItem
.
SearchFilletPX
=
driveData
?.
SearchFilletPX
??
0
;
miaiUserItem
.
BrowseRate
=
miaiUserItem
.
addUserType
==
2
?
(
miaiUserItem
.
BrowseRate
==
0
?
1
:
miaiUserItem
.
BrowseRate
)
:
0
;
miaiUserItem
.
FollowRate
=
miaiUserItem
.
addUserType
==
2
?
(
miaiUserItem
.
FollowRate
==
0
?
1
:
miaiUserItem
.
FollowRate
)
:
0
;
miaiUserItem
.
list
=
new
List
<
miaiUserDetail
>();
miaiUserItem
.
list
=
new
List
<
miaiUserDetail
>();
miaiUserItem
.
list
=
driveData
.
list
;
miaiUserItem
.
list
=
driveData
.
list
;
}
}
...
...
Mall.Module.Miai/MiaiModule.cs
View file @
3ef2aba9
...
@@ -31,6 +31,24 @@ namespace Mall.Module.Miai
...
@@ -31,6 +31,24 @@ namespace Mall.Module.Miai
private
readonly
RB_MiAi_FollowMemberRepository
miai_FollowMemberRepository
=
new
RB_MiAi_FollowMemberRepository
();
private
readonly
RB_MiAi_FollowMemberRepository
miai_FollowMemberRepository
=
new
RB_MiAi_FollowMemberRepository
();
/// <summary>
/// 用户管理
/// </summary>
private
readonly
Repository
.
User
.
RB_Member_UserRepository
member_UserRepository
=
new
Repository
.
User
.
RB_Member_UserRepository
();
#
region
会员信息
/// <summary>
/// 获取用户信息
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public
Model
.
Extend
.
User
.
RB_Member_User_Extend
GetMemberUserInfo
(
int
userId
)
{
return
member_UserRepository
.
GetEntity
(
userId
).
RefMapperTo
<
Model
.
Extend
.
User
.
RB_Member_User_Extend
>();
}
#
endregion
#
region
活动版块
#
region
活动版块
/// <summary>
/// <summary>
/// 获取活动版本分页列表
/// 获取活动版本分页列表
...
@@ -190,9 +208,11 @@ namespace Mall.Module.Miai
...
@@ -190,9 +208,11 @@ namespace Mall.Module.Miai
//查询用户性别
//查询用户性别
int
Sex
=
miai_BaseInfoRepository
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
model
.
UserId
}).
FirstOrDefault
()?.
Sex
??
0
;
int
Sex
=
miai_BaseInfoRepository
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
model
.
UserId
}).
FirstOrDefault
()?.
Sex
??
0
;
//查询当前用户是否已关注
//查询当前用户是否已关注
bool
IsFocus
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
model
.
UserId
,
CreateBy
=
userInfo
.
UserId
}).
Any
();
var
myFollowList
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
model
.
UserId
,
CreateBy
=
userInfo
.
UserId
});
bool
IsFocus
=
myFollowList
.
Any
();
var
otherFollowList
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
userInfo
.
UserId
,
CreateBy
=
model
.
UserId
});
//查询是否已关注我
//查询是否已关注我
bool
IsFocus2
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
userInfo
.
UserId
,
CreateBy
=
model
.
UserId
})
.
Any
();
bool
IsFocus2
=
otherFollowList
.
Any
();
return
new
return
new
{
{
model
.
Id
,
model
.
Id
,
...
@@ -204,12 +224,14 @@ namespace Mall.Module.Miai
...
@@ -204,12 +224,14 @@ namespace Mall.Module.Miai
umodel
.
Photo
,
umodel
.
Photo
,
Sex
,
Sex
,
model
.
IsOpenEnroll
,
model
.
IsOpenEnroll
,
Deadline
=
model
.
IsOpenEnroll
==
1
?
model
.
Deadline
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
,
Deadline
=
model
.
IsOpenEnroll
==
1
?
model
.
Deadline
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
,
CreateDate
=
model
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
CreateDate
=
model
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
PeopleNum
,
PeopleNum
,
IsEnroll
,
IsEnroll
,
IsFocus
=
IsFocus
==
true
&&
IsFocus2
==
true
?
2
:
IsFocus
==
true
?
1
:
0
,
IsFocus
=
IsFocus
==
true
&&
IsFocus2
==
true
?
2
:
IsFocus
==
true
?
1
:
0
,
ReplyNum
=
rlist
.
FirstOrDefault
()?.
ReplyNum
??
0
ReplyNum
=
rlist
.
FirstOrDefault
()?.
ReplyNum
??
0
,
MyFollowId
=
(
myFollowList
!=
null
&&
myFollowList
.
Any
())
?
myFollowList
.
FirstOrDefault
()?.
ID
:
0
,
OtherFollowId
=
(
otherFollowList
!=
null
&&
otherFollowList
.
Any
())
?
otherFollowList
.
FirstOrDefault
()?.
ID
:
0
};
};
}
}
...
@@ -543,17 +565,22 @@ namespace Mall.Module.Miai
...
@@ -543,17 +565,22 @@ namespace Mall.Module.Miai
public
List
<
RB_Miai_ActivityEnroll_Extend
>
GetActivityEnrollPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Miai_ActivityEnroll_Extend
demodel
,
AppletUserInfo
userInfo
)
public
List
<
RB_Miai_ActivityEnroll_Extend
>
GetActivityEnrollPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Miai_ActivityEnroll_Extend
demodel
,
AppletUserInfo
userInfo
)
{
{
var
list
=
miai_ActivityEnrollRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
var
list
=
miai_ActivityEnrollRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
UserIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
UserId
).
Distinct
());
string
UserIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
UserId
).
Distinct
());
//查询当前用户是否已关注
//查询当前用户是否已关注
var
flist
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserIds
=
UserIds
,
CreateBy
=
userInfo
.
UserId
});
var
flist
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserIds
=
UserIds
,
CreateBy
=
userInfo
.
UserId
});
//查询是否已关注我
//查询是否已关注我
var
flist2
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
userInfo
.
UserId
,
CreateByIds
=
UserIds
});
var
flist2
=
miai_FollowMemberRepository
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
UserId
=
userInfo
.
UserId
,
CreateByIds
=
UserIds
});
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
item
.
IsFocus
=
flist
.
Where
(
x
=>
x
.
UserId
==
item
.
UserId
).
Any
()
?
1
:
0
;
item
.
IsFocus
=
flist
.
Where
(
x
=>
x
.
UserId
==
item
.
UserId
).
Any
()
?
1
:
0
;
if
(
flist2
.
Where
(
x
=>
x
.
CreateBy
==
item
.
UserId
).
Any
()
&&
item
.
IsFocus
==
1
)
{
if
(
flist2
.
Where
(
x
=>
x
.
CreateBy
==
item
.
UserId
).
Any
()
&&
item
.
IsFocus
==
1
)
{
item
.
IsFocus
=
2
;
item
.
IsFocus
=
2
;
}
}
item
.
MyFollowId
=
(
flist
!=
null
&&
flist
.
Any
())
?
(
flist
.
FirstOrDefault
()?.
ID
??
0
)
:
0
;
item
.
OtherFollowId
=
(
flist2
!=
null
&&
flist2
.
Any
())
?
(
flist2
.
FirstOrDefault
()?.
ID
??
0
)
:
0
;
}
}
}
}
return
list
;
return
list
;
...
@@ -637,7 +664,8 @@ namespace Mall.Module.Miai
...
@@ -637,7 +664,8 @@ namespace Mall.Module.Miai
public
List
<
RB_Miai_ActivityEnroll_Extend
>
GetMyEnrollPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Miai_ActivityEnroll_Extend
demodel
)
public
List
<
RB_Miai_ActivityEnroll_Extend
>
GetMyEnrollPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Miai_ActivityEnroll_Extend
demodel
)
{
{
var
list
=
miai_ActivityEnrollRepository
.
GetMyEnrollPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
var
list
=
miai_ActivityEnrollRepository
.
GetMyEnrollPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
ActivityIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
ActivityId
).
Distinct
());
string
ActivityIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
ActivityId
).
Distinct
());
//查询活动帖子
//查询活动帖子
var
alist
=
miai_ActivityRepository
.
GetList
(
new
RB_Miai_Activity_Extend
()
{
TenantId
=
demodel
.
TenantId
,
ActivityIds
=
ActivityIds
},
true
);
var
alist
=
miai_ActivityRepository
.
GetList
(
new
RB_Miai_Activity_Extend
()
{
TenantId
=
demodel
.
TenantId
,
ActivityIds
=
ActivityIds
},
true
);
...
@@ -652,7 +680,8 @@ namespace Mall.Module.Miai
...
@@ -652,7 +680,8 @@ namespace Mall.Module.Miai
}
}
item
.
EnrollNum
=
elist
.
Where
(
x
=>
x
.
ActivityId
==
item
.
Id
).
FirstOrDefault
()?.
Number
??
0
;
item
.
EnrollNum
=
elist
.
Where
(
x
=>
x
.
ActivityId
==
item
.
Id
).
FirstOrDefault
()?.
Number
??
0
;
}
}
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
item
.
ActivityModel
=
alist
.
Where
(
x
=>
x
.
Id
==
item
.
ActivityId
).
FirstOrDefault
();
item
.
ActivityModel
=
alist
.
Where
(
x
=>
x
.
Id
==
item
.
ActivityId
).
FirstOrDefault
();
}
}
}
}
...
@@ -699,7 +728,8 @@ namespace Mall.Module.Miai
...
@@ -699,7 +728,8 @@ namespace Mall.Module.Miai
{
{
flag
=
miai_BaseInfoRepository
.
Insert
(
model
)
>
0
;
flag
=
miai_BaseInfoRepository
.
Insert
(
model
)
>
0
;
}
}
else
{
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
//{ nameof(RB_MiAi_BaseInfo_Extend.Sex),model.Sex},
//{ nameof(RB_MiAi_BaseInfo_Extend.Sex),model.Sex},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
Birthday
),
model
.
Birthday
},
{
nameof
(
RB_MiAi_BaseInfo_Extend
.
Birthday
),
model
.
Birthday
},
...
@@ -787,7 +817,8 @@ namespace Mall.Module.Miai
...
@@ -787,7 +817,8 @@ namespace Mall.Module.Miai
{
{
baseInfo
.
FollowNum
-=
1
;
baseInfo
.
FollowNum
-=
1
;
}
}
else
{
else
{
baseInfo
.
FollowNum
+=
1
;
baseInfo
.
FollowNum
+=
1
;
}
}
flag
=
miai_FollowMemberRepository
.
Update
(
keyValues
,
wheres
);
flag
=
miai_FollowMemberRepository
.
Update
(
keyValues
,
wheres
);
...
@@ -884,8 +915,8 @@ namespace Mall.Module.Miai
...
@@ -884,8 +915,8 @@ namespace Mall.Module.Miai
}
}
#
endregion
}
#
endregion
}
}
}
Mall.Repository/Miai/RB_MiAi_BaseInfoRepository.cs
View file @
3ef2aba9
...
@@ -37,6 +37,10 @@ namespace Mall.Repository.Miai
...
@@ -37,6 +37,10 @@ namespace Mall.Repository.Miai
{
{
sb
.
AppendFormat
(
" and Id={0}"
,
where
.
Id
);
sb
.
AppendFormat
(
" and Id={0}"
,
where
.
Id
);
}
}
if
(
where
.
UserId
>
0
)
{
sb
.
AppendFormat
(
" and UserId={0}"
,
where
.
UserId
);
}
}
}
return
Get
<
RB_MiAi_BaseInfo_Extend
>(
sb
.
ToString
()).
ToList
();
return
Get
<
RB_MiAi_BaseInfo_Extend
>(
sb
.
ToString
()).
ToList
();
}
}
...
@@ -124,7 +128,8 @@ LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.Status=0 and b.Blacklis
...
@@ -124,7 +128,8 @@ LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.Status=0 and b.Blacklis
}
}
else
if
(
where
.
Sort
==
2
)
else
if
(
where
.
Sort
==
2
)
{
{
sb
.
AppendFormat
(
" ORDER BY (a.FollowNum+a.BrowseNum) desc"
);
sb
.
AppendFormat
(
$@" ORDER BY (((a.FollowNum*
{
where
.
FollowRate
}
)+(a.BrowseNum*
{
where
.
BrowseRate
}
))) desc"
);
}
}
else
if
(
where
.
Sort
==
3
)
else
if
(
where
.
Sort
==
3
)
{
{
...
...
Mall.Repository/Miai/RB_MiAi_FollowMemberRepository.cs
View file @
3ef2aba9
...
@@ -76,7 +76,7 @@ namespace Mall.Repository.Miai
...
@@ -76,7 +76,7 @@ namespace Mall.Repository.Miai
public
List
<
RB_MiAi_FollowMember_Extend
>
GetFollowMemberPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_MiAi_FollowMember_Extend
where
)
public
List
<
RB_MiAi_FollowMember_Extend
>
GetFollowMemberPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_MiAi_FollowMember_Extend
where
)
{
{
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_FollowMember as a LEFT JOIN rb_member_user as b on a.
createby
=b.Id where a.`Status`=0"
);
sb
.
Append
(
$@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_FollowMember as a LEFT JOIN rb_member_user as b on a.
UserId
=b.Id where a.`Status`=0"
);
if
(
where
!=
null
)
if
(
where
!=
null
)
{
{
if
(
where
.
TenantId
>
0
)
if
(
where
.
TenantId
>
0
)
...
...
Mall.Repository/Miai/RB_Miai_ActivityDiscussRepository.cs
View file @
3ef2aba9
...
@@ -24,20 +24,26 @@ namespace Mall.Repository.Miai
...
@@ -24,20 +24,26 @@ namespace Mall.Repository.Miai
public
List
<
RB_Miai_ActivityDiscuss_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miai_ActivityDiscuss_Extend
dmodel
)
public
List
<
RB_Miai_ActivityDiscuss_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miai_ActivityDiscuss_Extend
dmodel
)
{
{
string
where
=
$" 1=1 and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
Status
)}
=0 "
;
string
where
=
$" 1=1 and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
Status
)}
=0 "
;
if
(
dmodel
.
TenantId
>
0
)
{
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
}
if
(
dmodel
.
MallBaseId
>
0
)
if
(
dmodel
.
MallBaseId
>
0
)
{
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
}
if
(
dmodel
.
ActivityId
>
0
)
{
if
(
dmodel
.
ActivityId
>
0
)
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ActivityId
)}
=
{
dmodel
.
ActivityId
}
"
;
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ActivityId
)}
=
{
dmodel
.
ActivityId
}
"
;
}
}
if
(
dmodel
.
UserId
>
0
)
if
(
dmodel
.
UserId
>
0
)
{
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
ParentId
>
0
)
if
(
dmodel
.
ParentId
>
0
)
{
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ParentId
)}
=
{
dmodel
.
ParentId
}
"
;
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ParentId
)}
=
{
dmodel
.
ParentId
}
"
;
...
@@ -46,6 +52,7 @@ namespace Mall.Repository.Miai
...
@@ -46,6 +52,7 @@ namespace Mall.Repository.Miai
{
{
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ParentId
)}
=0"
;
where
+=
$@" and d.
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ParentId
)}
=0"
;
}
}
string
sql
=
$@"select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName,b.Sex from RB_Miai_ActivityDiscuss d
string
sql
=
$@"select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName,b.Sex from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
...
@@ -74,7 +81,8 @@ where {where} order by d.Id asc";
...
@@ -74,7 +81,8 @@ where {where} order by d.Id asc";
{
{
where
+=
$@" and
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ActivityId
)}
=
{
dmodel
.
ActivityId
}
"
;
where
+=
$@" and
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ActivityId
)}
=
{
dmodel
.
ActivityId
}
"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ActivityIds
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ActivityIds
))
{
where
+=
$@" and
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ActivityId
)}
in(
{
dmodel
.
ActivityIds
}
)"
;
where
+=
$@" and
{
nameof
(
RB_Miai_ActivityDiscuss_Extend
.
ActivityId
)}
in(
{
dmodel
.
ActivityIds
}
)"
;
}
}
if
(
dmodel
.
UserId
>
0
)
if
(
dmodel
.
UserId
>
0
)
...
@@ -99,33 +107,40 @@ where {where} order by d.Id asc";
...
@@ -99,33 +107,40 @@ where {where} order by d.Id asc";
{
{
int
count
=
pidsList
.
Count
();
int
count
=
pidsList
.
Count
();
string
sql
=
""
;
string
sql
=
""
;
if
(
count
==
1
)
{
if
(
count
==
1
)
{
//只有一条数据
//只有一条数据
sql
=
$@"select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName from RB_Miai_ActivityDiscuss d
sql
=
$@"select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
where d.Status =0 and d.ParentId =
{
pidsList
.
FirstOrDefault
()}
order by d.Id asc limit
{
number
}
"
;
where d.Status =0 and d.ParentId =
{
pidsList
.
FirstOrDefault
()}
order by d.Id asc limit
{
number
}
"
;
}
}
for
(
var
i
=
0
;
i
<
count
;
i
++)
{
else
if
(
i
==
count
-
1
)
{
for
(
var
i
=
0
;
i
<
count
;
i
++)
{
{
//最后一条
if
(
i
==
count
-
1
)
sql
+=
$@"(select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName from RB_Miai_ActivityDiscuss d
{
//最后一条
sql
+=
$@"(select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
where d.Status =0 and d.ParentId =
{
pidsList
[
i
]}
order by d.Id asc limit
{
number
}
)"
;
where d.Status =0 and d.ParentId =
{
pidsList
[
i
]}
order by d.Id asc limit
{
number
}
)"
;
}
}
else
{
else
sql
+=
$@"(select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName from RB_Miai_ActivityDiscuss d
{
sql
+=
$@"(select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
where d.Status =0 and d.ParentId =
{
pidsList
[
i
]}
order by d.Id asc limit
{
number
}
)
where d.Status =0 and d.ParentId =
{
pidsList
[
i
]}
order by d.Id asc limit
{
number
}
)
union
union
"
;
"
;
}
}
}
}
}
return
Get
<
RB_Miai_ActivityDiscuss_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Miai_ActivityDiscuss_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// <summary>
...
...
Mall.Repository/Miai/RB_Miai_ActivityEnrollRepository.cs
View file @
3ef2aba9
...
@@ -38,6 +38,10 @@ namespace Mall.Repository.Miai
...
@@ -38,6 +38,10 @@ namespace Mall.Repository.Miai
{
{
where
+=
$@" and e.
{
nameof
(
RB_Miai_ActivityEnroll_Extend
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
where
+=
$@" and e.
{
nameof
(
RB_Miai_ActivityEnroll_Extend
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and e.
{
nameof
(
RB_Miai_ActivityEnroll_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
string
sql
=
$@"select e.*,u.Name as UserName,u.Photo,b.Sex from RB_Miai_ActivityEnroll e
string
sql
=
$@"select e.*,u.Name as UserName,u.Photo,b.Sex from RB_Miai_ActivityEnroll e
left join rb_member_user u on e.UserId = u.Id
left join rb_member_user u on e.UserId = u.Id
left join rb_miai_baseinfo b on e.UserId =b.UserId
left join rb_miai_baseinfo b on e.UserId =b.UserId
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
3ef2aba9
...
@@ -1339,7 +1339,9 @@ namespace Mall.WebApi.Controllers
...
@@ -1339,7 +1339,9 @@ namespace Mall.WebApi.Controllers
{
{
TenantId
=
TenantId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
MallBaseId
=
MallBaseId
,
Sort
=
2
Sort
=
2
,
FollowRate
=
miAiUserItem
.
FollowRate
==
0
?
1
:
miAiUserItem
.
FollowRate
,
BrowseRate
=
miAiUserItem
.
BrowseRate
==
0
?
1
:
miAiUserItem
.
BrowseRate
,
});
});
List
<
miaiUserDetail
>
newGoodsList
=
new
List
<
miaiUserDetail
>();
List
<
miaiUserDetail
>
newGoodsList
=
new
List
<
miaiUserDetail
>();
foreach
(
var
goodItem
in
miAiUserItem
.
list
)
foreach
(
var
goodItem
in
miAiUserItem
.
list
)
...
...
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
View file @
3ef2aba9
...
@@ -94,7 +94,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -94,7 +94,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
ForumId
,
x
.
ForumId
,
x
.
ForumName
,
x
.
ForumName
,
x
.
ForumIcon
,
x
.
ForumIcon
,
Deadline
=
x
.
IsOpenEnroll
==
1
?
x
.
Deadline
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
,
Deadline
=
x
.
IsOpenEnroll
==
1
?
x
.
Deadline
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
,
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
});
return
ApiResult
.
Success
(
""
,
pagelist
);
return
ApiResult
.
Success
(
""
,
pagelist
);
...
@@ -345,7 +345,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -345,7 +345,7 @@ namespace Mall.WebApi.Controllers.MallBase
#
region
内容是否违规
#
region
内容是否违规
try
try
{
{
var
miniModel
=
programModule
.
GetMiniProgramModule
(
new
Model
.
Extend
.
User
.
RB_MiniProgram_Extend
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
var
miniModel
=
programModule
.
GetMiniProgramModule
(
new
Model
.
Extend
.
User
.
RB_MiniProgram_Extend
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
int
violationNum
=
programMsgModule
.
CheckViolation
(
miniModel
,
demodel
.
Content
);
int
violationNum
=
programMsgModule
.
CheckViolation
(
miniModel
,
demodel
.
Content
);
if
(
violationNum
==
0
)
if
(
violationNum
==
0
)
{
{
...
@@ -455,7 +455,9 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -455,7 +455,9 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
PeopleNum
,
x
.
PeopleNum
,
x
.
Remark
,
x
.
Remark
,
x
.
IsFocus
,
x
.
IsFocus
,
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
x
.
MyFollowId
,
x
.
OtherFollowId
});
});
return
ApiResult
.
Success
(
""
,
pagelist
);
return
ApiResult
.
Success
(
""
,
pagelist
);
}
}
...
@@ -661,109 +663,93 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -661,109 +663,93 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
}
}
/// <summary>
/// 生肖
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
string
GetShengXiao
(
DateTime
birthday
)
{
System
.
Globalization
.
ChineseLunisolarCalendar
chinseCaleander
=
new
System
.
Globalization
.
ChineseLunisolarCalendar
();
string
TreeYear
=
"鼠牛虎兔龙蛇马羊猴鸡狗猪"
;
int
intYear
=
chinseCaleander
.
GetSexagenaryYear
(
birthday
);
string
Tree
=
TreeYear
.
Substring
(
chinseCaleander
.
GetTerrestrialBranch
(
intYear
)
-
1
,
1
);
return
Tree
;
public
ApiResult
GetMiAiBaseIfo
()
}
/// <summary>
/// 获取星座
/// </summary>
/// <param name="birthday"></param>
/// <returns></returns>
public
string
GetAtomFromBirthday
(
DateTime
birthday
)
{
{
float
birthdayF
=
0.00F
;
var
req
=
RequestParm
;
JObject
parm
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
var
userInfo
=
AppletUserInfo
;
int
userId
=
parm
.
GetInt
(
"UserId"
);
int
isFollow
=
-
1
;
//-1 自己, 0-未关注,1-已关注,2-别人关注了你,3-互相关注
if
(
birthday
.
Month
==
1
&&
birthday
.
Day
<
20
)
int
MyFollowId
=
0
;
int
OtherFollowId
=
0
;
if
(
userId
==
0
)
{
{
birthdayF
=
float
.
Parse
(
string
.
Format
(
"13.{0}"
,
birthday
.
Day
))
;
userId
=
userInfo
.
UserId
;
}
}
else
var
oldList
=
miaiModule
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
{
Status
=
0
,
UserId
=
userId
,
CreateBy
=
userInfo
.
UserId
,
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
});
var
oldOtherList
=
miaiModule
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
{
Status
=
0
,
UserId
=
userInfo
.
UserId
,
CreateBy
=
userId
,
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
});
if
(
oldList
!=
null
&&
oldList
.
Any
()
&&
oldOtherList
!=
null
&&
oldOtherList
.
Any
())
{
{
birthdayF
=
float
.
Parse
(
string
.
Format
(
"{0}.{1}"
,
birthday
.
Month
,
birthday
.
Day
));
isFollow
=
3
;
MyFollowId
=
oldList
.
FirstOrDefault
()?.
ID
??
0
;
OtherFollowId
=
oldOtherList
.
FirstOrDefault
()?.
ID
??
0
;
}
}
float
[]
atomBound
=
{
1.20F
,
2.20F
,
3.21F
,
4.21F
,
5.21F
,
6.22F
,
7.23F
,
8.23F
,
9.23F
,
10.23F
,
11.21F
,
12.22F
,
13.20F
};
else
if
(
oldList
!=
null
&&
oldList
.
Any
())
string
[]
atoms
=
{
"水瓶座"
,
"双鱼座"
,
"白羊座"
,
"金牛座"
,
"双子座"
,
"巨蟹座"
,
"狮子座"
,
"处女座"
,
"天秤座"
,
"天蝎座"
,
"射手座"
,
"魔羯座"
};
string
ret
=
"靠!外星人啊。"
;
for
(
int
i
=
0
;
i
<
atomBound
.
Length
-
1
;
i
++)
{
{
if
(
atomBound
[
i
]
<=
birthdayF
&&
atomBound
[
i
+
1
]
>
birthdayF
)
isFollow
=
1
;
{
MyFollowId
=
oldList
.
FirstOrDefault
()?.
ID
??
0
;
ret
=
atoms
[
i
];
}
break
;
else
if
(
oldOtherList
!=
null
&&
oldOtherList
.
Any
())
}
{
isFollow
=
2
;
OtherFollowId
=
oldOtherList
.
FirstOrDefault
()?.
ID
??
0
;
}
else
{
isFollow
=
0
;
}
}
return
ret
;
}
public
ApiResult
GetMiAiBaseIfo
()
var
oldUserInfo
=
miaiModule
.
GetMemberUserInfo
(
userId
);
{
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
userId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
var
req
=
RequestParm
;
JObject
parm
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
var
userInfo
=
AppletUserInfo
;
if
(
oldUserInfo
!=
null
&&
oldUserInfo
.
Id
>
0
)
int
userId
=
parm
.
GetInt
(
"UserId"
);
int
isFollow
=
-
1
;
//-1 自己, 0-未关注,1-已关注,2-别人关注了你,3-互相关注
if
(
userId
==
0
)
{
{
userId
=
userInfo
.
UserId
;
int
IsAttestation
=
0
;
var
oldList
=
miaiModule
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
{
Status
=
0
,
UserId
=
userId
,
CreateBy
=
userInfo
.
UserId
,
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
});
if
(
oldBaseInfo
!=
null
&&
oldBaseInfo
.
Id
>
0
)
var
oldOtherList
=
miaiModule
.
GetFollowMemberList
(
new
RB_MiAi_FollowMember_Extend
{
Status
=
0
,
UserId
=
userInfo
.
UserId
,
CreateBy
=
userId
,
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
});
if
(
oldList
!=
null
&&
oldList
.
Any
()
&&
oldOtherList
!=
null
&&
oldOtherList
.
Any
())
{
isFollow
=
3
;
}
else
if
(
oldList
!=
null
&&
oldList
.
Any
())
{
isFollow
=
1
;
}
else
if
(
oldOtherList
!=
null
&&
oldOtherList
.
Any
())
{
{
isFollow
=
2
;
oldBaseInfo
.
AlbumList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Album
))
{
oldBaseInfo
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
oldBaseInfo
.
Album
);
}
else
{
oldBaseInfo
.
AlbumList
=
new
List
<
string
>();
}
IsAttestation
=
1
;
//已认证
}
}
else
else
{
{
isFollow
=
0
;
oldBaseInfo
=
new
RB_MiAi_BaseInfo_Extend
();
}
}
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
userId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
oldBaseInfo
!=
null
&&
oldBaseInfo
.
Id
>
0
)
{
oldBaseInfo
.
AlbumList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Album
))
{
oldBaseInfo
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
oldBaseInfo
.
Album
);
}
}
var
result
=
new
var
result
=
new
{
{
MyFollowId
,
OtherFollowId
,
oldUserInfo
.
Id
,
oldUserInfo
.
Name
,
oldUserInfo
.
Photo
,
IsAttestation
,
IsFollow
=
isFollow
,
IsFollow
=
isFollow
,
oldBaseInfo
.
Sex
,
Sex
=
oldBaseInfo
?.
Sex
??
0
,
oldBaseInfo
.
IDCardNo
,
IDCardNo
=
oldBaseInfo
?.
IDCardNo
??
""
,
oldBaseInfo
.
RealName
,
RealName
=
oldBaseInfo
?.
RealName
??
""
,
oldBaseInfo
.
IDCard
,
IDCard
=
oldBaseInfo
?.
IDCard
??
""
,
oldBaseInfo
.
IDCardBack
,
IDCardBack
=
oldBaseInfo
?.
IDCardBack
??
""
,
SexStr
=
oldBaseInfo
.
Sex
==
1
?
"男"
:
"女
"
,
SexStr
=
(
oldBaseInfo
!=
null
&&
oldBaseInfo
.
Id
>
0
)
?
(
oldBaseInfo
.
Sex
==
1
?
"男"
:
"女"
)
:
"
"
,
oldBaseInfo
.
Birthday
,
Birthday
=
oldBaseInfo
.
Birthday
??
""
,
Age
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetAge
(
oldBaseInfo
.
Birthday
),
//年纪
Age
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetAge
(
oldBaseInfo
.
Birthday
),
//年纪
ShenXiao
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
GetShengXiao
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//生肖
ShenXiao
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetShengXiao
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//生肖
ConoldBaseInfostellation
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
GetAtomFromBirthday
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//星座
ConoldBaseInfostellation
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetAtomFromBirthday
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//星座
oldBaseInfo
.
Height
,
oldBaseInfo
?
.
Height
,
oldBaseInfo
.
Weight
,
oldBaseInfo
?
.
Weight
,
Marriage
=
(
oldBaseInfo
.
Marriage
.
HasValue
&&
oldBaseInfo
.
Marriage
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
Marriage
)
:
""
,
Marriage
=
(
oldBaseInfo
.
Marriage
.
HasValue
&&
oldBaseInfo
.
Marriage
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
Marriage
)
:
""
,
EducationType
=
(
oldBaseInfo
.
EducationType
.
HasValue
&&
oldBaseInfo
.
EducationType
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
EducationType
)
:
""
,
EducationType
=
(
oldBaseInfo
.
EducationType
.
HasValue
&&
oldBaseInfo
.
EducationType
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
EducationType
)
:
""
,
YearMoney
=
oldBaseInfo
.
YearMoney
??
""
,
YearMoney
=
oldBaseInfo
.
YearMoney
??
""
,
...
@@ -785,7 +771,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -785,7 +771,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
else
else
{
{
return
ApiResult
.
Failed
(
"用户
暂未认证
"
);
return
ApiResult
.
Failed
(
"用户
信息不存在
"
);
}
}
}
}
...
@@ -909,6 +895,10 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -909,6 +895,10 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
else
else
{
{
if
(
query
.
UserId
==
userInfo
.
UserId
)
{
return
ApiResult
.
Failed
(
"关注对象不能是自己"
);
}
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
query
.
CreateBy
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
query
.
CreateBy
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
oldBaseInfo
==
null
||
oldBaseInfo
.
Id
==
0
)
if
(
oldBaseInfo
==
null
||
oldBaseInfo
.
Id
==
0
)
...
@@ -1030,6 +1020,6 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1030,6 +1020,6 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Miai/MiaiController.cs
View file @
3ef2aba9
...
@@ -446,6 +446,62 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -446,6 +446,62 @@ namespace Mall.WebApi.Controllers.MallBase
#
endregion
#
endregion
#
region
基础信息
public
ApiResult
GetMiAiBaseIfo
()
{
var
parms
=
RequestParm
;
JObject
parm
=
JObject
.
Parse
(
parms
.
msg
.
ToString
());
// var userInfo = AppletUserInfo;
int
userId
=
parm
.
GetInt
(
"UserId"
);
var
oldBaseInfo
=
miaiModule
.
GetBaseInfoList
(
new
RB_MiAi_BaseInfo_Extend
{
UserId
=
userId
,
TenantId
=
UserInfo
.
TenantId
,
MallBaseId
=
UserInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
oldBaseInfo
!=
null
&&
oldBaseInfo
.
Id
>
0
)
{
oldBaseInfo
.
AlbumList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Album
))
{
oldBaseInfo
.
AlbumList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
oldBaseInfo
.
Album
);
}
var
result
=
new
{
oldBaseInfo
.
Sex
,
oldBaseInfo
.
IDCardNo
,
oldBaseInfo
.
RealName
,
oldBaseInfo
.
IDCard
,
oldBaseInfo
.
IDCardBack
,
SexStr
=
oldBaseInfo
.
Sex
==
1
?
"男"
:
"女"
,
oldBaseInfo
.
Birthday
,
Age
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetAge
(
oldBaseInfo
.
Birthday
),
//年纪
ShenXiao
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetShengXiao
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//生肖
ConoldBaseInfostellation
=
string
.
IsNullOrWhiteSpace
(
oldBaseInfo
.
Birthday
)
?
""
:
StringHelper
.
GetAtomFromBirthday
(
Convert
.
ToDateTime
((
oldBaseInfo
.
Birthday
))),
//星座
oldBaseInfo
.
Height
,
oldBaseInfo
.
Weight
,
Marriage
=
(
oldBaseInfo
.
Marriage
.
HasValue
&&
oldBaseInfo
.
Marriage
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
Marriage
)
:
""
,
EducationType
=
(
oldBaseInfo
.
EducationType
.
HasValue
&&
oldBaseInfo
.
EducationType
.
Value
>
0
)
?
EnumHelper
.
GetEnumName
(
oldBaseInfo
.
EducationType
)
:
""
,
YearMoney
=
oldBaseInfo
.
YearMoney
??
""
,
HuKou
=
oldBaseInfo
.
HuKou
??
""
,
NativePlace
=
oldBaseInfo
.
NativePlace
??
""
,
HouseInfo
=
oldBaseInfo
.
HouseInfo
??
""
,
SchoolInfo
=
oldBaseInfo
.
SchoolInfo
??
""
,
MotherInfo
=
oldBaseInfo
.
MotherInfo
??
""
,
FatherInfo
=
oldBaseInfo
.
FatherInfo
??
""
,
Job
=
oldBaseInfo
.
Job
??
""
,
OtherPople
=
oldBaseInfo
.
OtherPople
??
""
,
MajorInfo
=
oldBaseInfo
.
MajorInfo
??
""
,
CarInfo
=
oldBaseInfo
.
CarInfo
??
""
,
About
=
oldBaseInfo
.
About
??
""
,
IdealLove
=
oldBaseInfo
.
IdealLove
??
""
,
oldBaseInfo
.
AlbumList
};
return
ApiResult
.
Success
(
""
,
result
);
}
else
{
return
ApiResult
.
Failed
(
"用户暂未认证"
);
}
}
#
endregion
}
}
}
}
\ No newline at end of file
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