Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
xiaozhan
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
冷斌
xiaozhan
Commits
c74fbc66
Commit
c74fbc66
authored
Feb 17, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
b787bd47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
api/Appapi/Api/Home.php
+2
-1
api/Appapi/Domain/Home.php
+2
-2
api/Appapi/Model/Home.php
+10
-1
No files found.
api/Appapi/Api/Home.php
View file @
c74fbc66
...
@@ -32,6 +32,7 @@ class Api_Home extends PhalApi_Api {
...
@@ -32,6 +32,7 @@ class Api_Home extends PhalApi_Api {
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'require'
=>
true
,
'min'
=>
1
,
'desc'
=>
'用户ID'
),
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'require'
=>
true
,
'min'
=>
1
,
'desc'
=>
'用户ID'
),
'key'
=>
array
(
'name'
=>
'key'
,
'type'
=>
'string'
,
'default'
=>
''
,
'desc'
=>
'用户ID'
),
'key'
=>
array
(
'name'
=>
'key'
,
'type'
=>
'string'
,
'default'
=>
''
,
'desc'
=>
'用户ID'
),
'p'
=>
array
(
'name'
=>
'p'
,
'type'
=>
'int'
,
'default'
=>
'1'
,
'desc'
=>
'页数'
),
'p'
=>
array
(
'name'
=>
'p'
,
'type'
=>
'int'
,
'default'
=>
'1'
,
'desc'
=>
'页数'
),
'type'
=>
array
(
'name'
=>
'type'
,
'type'
=>
'int'
,
'default'
=>
0
,
'desc'
=>
'类型'
),
),
),
'interest'
=>
array
(
'interest'
=>
array
(
...
@@ -364,7 +365,7 @@ class Api_Home extends PhalApi_Api {
...
@@ -364,7 +365,7 @@ class Api_Home extends PhalApi_Api {
}
}
$domain
=
new
Domain_Home
();
$domain
=
new
Domain_Home
();
$info
=
$domain
->
search
(
$uid
,
$key
,
$p
);
$info
=
$domain
->
search
(
$uid
,
$key
,
$p
,
$this
->
type
);
$rs
[
'info'
]
=
$info
;
$rs
[
'info'
]
=
$info
;
...
...
api/Appapi/Domain/Home.php
View file @
c74fbc66
...
@@ -55,11 +55,11 @@ class Domain_Home {
...
@@ -55,11 +55,11 @@ class Domain_Home {
return
$rs
;
return
$rs
;
}
}
public
function
search
(
$uid
,
$key
,
$p
)
{
public
function
search
(
$uid
,
$key
,
$p
,
$type
)
{
$rs
=
array
();
$rs
=
array
();
$model
=
new
Model_Home
();
$model
=
new
Model_Home
();
$rs
=
$model
->
search
(
$uid
,
$key
,
$p
);
$rs
=
$model
->
search
(
$uid
,
$key
,
$p
,
$type
);
return
$rs
;
return
$rs
;
}
}
...
...
api/Appapi/Model/Home.php
View file @
c74fbc66
...
@@ -378,7 +378,7 @@ class Model_Home extends PhalApi_Model_NotORM {
...
@@ -378,7 +378,7 @@ class Model_Home extends PhalApi_Model_NotORM {
}
}
/* 搜索 */
/* 搜索 */
public
function
search
(
$uid
,
$key
,
$p
)
{
public
function
search
(
$uid
,
$key
,
$p
,
$type
)
{
if
(
$p
<
1
){
if
(
$p
<
1
){
$p
=
1
;
$p
=
1
;
}
}
...
@@ -408,6 +408,15 @@ class Model_Home extends PhalApi_Model_NotORM {
...
@@ -408,6 +408,15 @@ class Model_Home extends PhalApi_Model_NotORM {
->
where
(
'touid=?'
,
$v
[
'id'
])
->
where
(
'touid=?'
,
$v
[
'id'
])
->
count
();
->
count
();
$v
[
'fans'
]
=
$touids
;
$v
[
'fans'
]
=
$touids
;
if
(
$type
)
{
$one
=
DI
()
->
notorm
->
family
->
where
(
"uid =
{
$v
[
'id'
]
}
and state = 2"
)
->
count
();
$two
=
DI
()
->
notorm
->
users_family
->
where
(
"uid =
{
$v
[
'id'
]
}
and state = 2"
)
->
count
();
$type
=
0
;
if
(
$one
||
$two
)
{
$type
=
1
;
}
$v
[
'fans'
]
=
$type
;
}
$result
[
$k
]
=
$v
;
$result
[
$k
]
=
$v
;
}
}
...
...
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