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
a332af27
Commit
a332af27
authored
Oct 16, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分前端接口:增量媒资接口增加媒资更新时间字段(分前端取最后一条作为下次请求的开始时间)
parent
56e7af0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
FrontAction.class.php
SooonerHotel/App/Lib/Action/Api/FrontAction.class.php
+8
-4
No files found.
SooonerHotel/App/Lib/Action/Api/FrontAction.class.php
View file @
a332af27
...
...
@@ -63,6 +63,7 @@ class FrontAction extends Action
}
}
header
(
'Content-type: application/json'
);
//json
echo
json_encode
(
$config
);
exit
;
...
...
@@ -87,7 +88,8 @@ class FrontAction extends Action
$end
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$_GET
[
"end"
]));
$page
=
$_GET
[
"page"
];
$sqlTotal
=
"SELECT count(1) total FROM sh_hotel_media_map_
$spid
WHERE hotel_id=
$hid
AND updatetime BETWEEN '
$start
' AND '
$end
';"
;
$sqlTotal
=
"SELECT count(1) total FROM sh_hotel_media_map_
$spid
WHERE hotel_id=
$hid
AND updatetime BETWEEN '
$start
' AND '
$end
';"
;
// echo $sqlTotal;exit;
$totalArr
=
M
(
""
)
->
query
(
$sqlTotal
);
$total
=
0
;
...
...
@@ -97,9 +99,10 @@ class FrontAction extends Action
$page_num
=
ceil
(
$total
/
$page_size
);
$limit_from
=
(
$page
-
1
)
*
$page_size
;
$sql
=
"SELECT mw.id,mw.code,mw.url_play,hm.status,hm.status_inject"
.
" FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_
$spid
"
.
" WHERE hotel_id=
$hid
AND updatetime BETWEEN '
$start
' AND '
$end
' ORDER BY updatetime,media_id ASC LIMIT
$limit_from
,
$page_size
) hm"
$sql
=
"SELECT mw.id,mw.code,mw.url_play,hm.status,hm.status_inject,hm.updatetime"
.
" FROM (SELECT media_id,hotel_id,status,status_inject,updatetime FROM sh_hotel_media_map_
$spid
"
.
" WHERE hotel_id=
$hid
AND updatetime BETWEEN '
$start
' AND '
$end
'
ORDER BY updatetime,media_id ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
;
...
...
@@ -110,6 +113,7 @@ class FrontAction extends Action
$result
[
"page_num"
]
=
(
int
)
$page_num
;
$result
[
"list"
]
=
$list
;
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