Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
4c6949fc
Commit
4c6949fc
authored
Oct 07, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的收藏BUG
parent
2dda0176
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
3 deletions
+7
-3
application/api/controller/Base.php
+1
-1
application/api/controller/Order.php
+1
-0
application/api/controller/Project.php
+1
-1
application/api/controller/User.php
+2
-0
application/common/model/User.php
+2
-1
No files found.
application/api/controller/Base.php
View file @
4c6949fc
...
...
@@ -27,7 +27,7 @@ class Base extends Controller
// var_dump($params);
// echo $this->getSignature($params); exit;
//
验证签名
//
验证签名
// if (!$this->checkSignature($params)) {
// echo json_encode(["code" => 1, "msg" => "auth failed"]);
// die;
...
...
application/api/controller/Order.php
View file @
4c6949fc
...
...
@@ -356,6 +356,7 @@ class Order extends Base
->
where
(
'uid'
,
$uid
)
->
where
(
'type'
,
1
)
->
page
(
$p
,
$page
)
->
order
(
'id'
,
'desc'
)
->
select
();
$order
=
collection
(
$order
);
if
(
$order
->
isEmpty
())
{
...
...
application/api/controller/Project.php
View file @
4c6949fc
...
...
@@ -233,7 +233,7 @@ class Project extends Base
if
(
!
$project
)
return
[
'code'
=>
1
,
'msg'
=>
'活动或该商家不存在'
];
if
(
$data
)
{
//已经收藏->取消收藏
if
(
$data
->
delete
())
{
if
(
$data
->
delete
(
true
))
{
$project
->
collect_num
--
;
$project
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'取消收藏成功!'
,
'collect'
=>
'remove'
];
...
...
application/api/controller/User.php
View file @
4c6949fc
...
...
@@ -196,9 +196,11 @@ class User extends Base
$p
=
input
(
'post.p/d'
,
1
);
$page
=
input
(
'post.page/d'
,
8
);
$list
=
collection
(
UserModel
::
get
(
$uid
)
->
project
()
->
page
(
$p
,
$page
)
->
select
());
if
(
$list
->
isEmpty
())
{
return
[
'code'
=>
1
,
'msg'
=>
'没有更多'
];
}
...
...
application/common/model/User.php
View file @
4c6949fc
...
...
@@ -33,7 +33,7 @@ class User extends BaseModel
// 用户收藏多对多
public
function
project
()
{
return
$this
->
belongsToMany
(
'Project'
,
'user_collections'
,
'pid'
,
'uid'
);
return
$this
->
belongsToMany
(
'Project'
,
'user_collections'
,
'pid'
,
'uid'
)
->
order
(
'pivot.id'
,
'desc'
)
;
}
}
\ 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