Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhupu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
zhupu
Commits
bc9c0054
Commit
bc9c0054
authored
Sep 14, 2023
by
sugar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
热更新
parent
d5b252be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
2 deletions
+74
-2
application/api/controller/Friend.php
application/api/controller/Friend.php
+45
-2
application/api/model/HotcircleModel.php
application/api/model/HotcircleModel.php
+29
-0
No files found.
application/api/controller/Friend.php
View file @
bc9c0054
...
...
@@ -10,6 +10,7 @@ namespace app\api\controller;
use
app\api\model\Addr
;
use
app\api\model\FriendCommentModel
;
use
app\api\model\FriendLikeModel
;
use
app\api\model\HotcircleModel
;
use
app\common\controller\Api
;
use
fast\Tree
;
use
think\Db
;
...
...
@@ -21,6 +22,43 @@ class Friend extends Api{
protected
$noNeedLogin
=
[
'*'
];
protected
$noNeedRight
=
[
'*'
];
/**
* 热门圈子列表
*/
public
function
getCircleList
(){
$page
=
$this
->
request
->
post
(
'page'
,
1
);
$type
=
$this
->
request
->
post
(
'type'
,
''
);
//my_circle:我的圈子
$where
=
[
'status'
=>
1
];
if
(
$type
==
'my_circle'
){
$where
[
'user_id'
]
=
$this
->
auth
->
id
;
}
$list
=
HotcircleModel
::
where
(
$where
)
->
page
(
$page
)
->
limit
(
$this
->
pageSize
)
->
select
();
$this
->
success
(
'获取成功'
,[
'list'
=>
$list
]);
}
/**
* 热门圈子列表
*/
public
function
getMyCircles
(){
$page
=
$this
->
request
->
post
(
'page'
,
1
);
$type
=
$this
->
request
->
post
(
'type'
,
''
);
//my_circle:我的圈子
$where
=
[
'status'
=>
1
];
if
(
$type
==
'my_circle'
){
$where
[
'user_id'
]
=
$this
->
auth
->
id
;
}
$list
=
HotcircleModel
::
alais
(
'hc'
)
->
join
(
'join_circle jc'
,
'hc.id=jc.hot_circle_id'
)
->
where
(
$where
)
->
page
(
$page
)
->
limit
(
$this
->
pageSize
)
->
select
();
$this
->
success
(
'获取成功'
,[
'list'
=>
$list
]);
}
/**
* 发布朋友圈
* @param content 朋友圈信息
...
...
@@ -47,7 +85,7 @@ class Friend extends Api{
'nickname'
=>
$fastim
[
'nickname'
],
'ip'
=>
$this
->
request
->
ip
(),
'create_time'
=>
time
(),
'
province
'
=>
$addr
[
'Name'
]
'
addr
'
=>
$addr
[
'Name'
]
];
$res
=
Friendcircle
::
create
(
$data
);
if
(
!
$res
->
id
){
...
...
@@ -113,7 +151,12 @@ class Friend extends Api{
*/
public
function
getFriendList
(){
$page
=
$this
->
request
->
post
(
'page'
,
1
);
$list
=
Friendcircle
::
where
([
'status'
=>
1
])
$type
=
$this
->
request
->
post
(
'type'
,
''
);
//my_circle:我的圈子
$where
=
[
'status'
=>
1
];
if
(
$type
==
'my_circle'
){
$where
[
'user_id'
]
=
$this
->
auth
->
id
;
}
$list
=
Friendcircle
::
where
(
$where
)
->
page
(
$page
)
->
limit
(
$this
->
pageSize
)
->
select
();
...
...
application/api/model/HotcircleModel.php
0 → 100644
View file @
bc9c0054
<?php
/**
* Created by PhpStorm.
* User: pc
* Date: 2023/8/21
* Time: 14:41
*/
namespace
app\api\model
;
use
think\Model
;
class
HotcircleModel
extends
Model
{
// 表名
protected
$name
=
'hot_circle'
;
// 自动写入时间戳字段
protected
$autoWriteTimestamp
=
false
;
// 追加属性
protected
$append
=
[
];
}
\ 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