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
584efe38
Commit
584efe38
authored
Mar 05, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交完善关注
parent
01839bcb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
15 deletions
+42
-15
RB_Miai_ActivityEnroll_Extend.cs
Mall.Model/Extend/Miai/RB_Miai_ActivityEnroll_Extend.cs
+10
-0
MiaiModule.cs
Mall.Module.Miai/MiaiModule.cs
+28
-15
AppletMiaiController.cs
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
+4
-0
No files found.
Mall.Model/Extend/Miai/RB_Miai_ActivityEnroll_Extend.cs
View file @
584efe38
...
@@ -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.Miai/MiaiModule.cs
View file @
584efe38
...
@@ -202,9 +202,11 @@ namespace Mall.Module.Miai
...
@@ -202,9 +202,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
,
...
@@ -216,12 +218,14 @@ namespace Mall.Module.Miai
...
@@ -216,12 +218,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
};
};
}
}
...
@@ -555,17 +559,22 @@ namespace Mall.Module.Miai
...
@@ -555,17 +559,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
;
...
@@ -649,7 +658,8 @@ namespace Mall.Module.Miai
...
@@ -649,7 +658,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
);
...
@@ -664,7 +674,8 @@ namespace Mall.Module.Miai
...
@@ -664,7 +674,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
();
}
}
}
}
...
@@ -711,7 +722,8 @@ namespace Mall.Module.Miai
...
@@ -711,7 +722,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
},
...
@@ -799,7 +811,8 @@ namespace Mall.Module.Miai
...
@@ -799,7 +811,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
);
...
...
Mall.WebApi/Controllers/Miai/AppletMiaiController.cs
View file @
584efe38
...
@@ -875,6 +875,10 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -875,6 +875,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
)
...
...
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