Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴贤德
SooonerHotel
Commits
9bb541d2
Commit
9bb541d2
authored
Sep 06, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
站点改造:中心接口——增加站点配置接口
parent
96cdf453
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
CenterAction.class.php
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
+23
-1
No files found.
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
View file @
9bb541d2
...
...
@@ -33,7 +33,7 @@ class CenterAction extends Action
foreach
(
$arr
as
$item
){
$result
[
$item
[
"k"
]]
=
$item
[
"v"
];
}
header
(
'Content-type: application/json'
);
//json
echo
json_encode
(
$result
);
exit
;
}
...
...
@@ -54,7 +54,29 @@ class CenterAction extends Action
$result
[
$item
[
"id"
]][
"push_offset"
]
=
$item
[
"push_offset"
];
$result
[
$item
[
"id"
]][
$item
[
"k"
]]
=
$item
[
"v"
];
}
header
(
'Content-type: application/json'
);
//json
echo
json_encode
(
$result
);
exit
;
}
/**
* 站点配置接口
*
*/
public
function
conf_sites
(){
$sql
=
"SELECT site.id,site.name,site.pull_api,site.offline_key,sp.spids FROM sh_site site"
.
" JOIN (SELECT site_id,GROUP_CONCAT(id) spids"
.
" FROM sh_sp WHERE status=0 GROUP BY site_id) sp ON sp.site_id=site.id"
.
" WHERE site.status=0;"
;
$arr
=
M
(
""
)
->
query
(
$sql
);
foreach
(
$arr
as
$item
){
$result
[
$item
[
"id"
]][
"id"
]
=
$item
[
"id"
];
$result
[
$item
[
"id"
]][
"name"
]
=
$item
[
"name"
];
$result
[
$item
[
"id"
]][
"pull_api"
]
=
$item
[
"pull_api"
];
$result
[
$item
[
"id"
]][
"offline_key"
]
=
$item
[
"offline_key"
];
$result
[
$item
[
"id"
]][
"spids"
]
=
$item
[
"spids"
];
}
header
(
'Content-type: application/json'
);
//json
echo
json_encode
(
$result
);
exit
;
}
...
...
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