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
fbb7fcd5
Commit
fbb7fcd5
authored
Aug 29, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.实时媒资下线接口
2.修改华数测试媒资增量接口/api/center/incrementList (线上数据库版本有bug 多表join有问题)
parent
8b972d97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
12 deletions
+55
-12
CenterAction.class.php
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
+55
-12
No files found.
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
View file @
fbb7fcd5
...
...
@@ -48,6 +48,53 @@ class CenterAction extends Action
}
/*
* 媒资实时下线接口(华数经纬cms调用,下线媒资,同时需要下线所有酒店片库中相应媒资)
* GET /api/center/media_offline?spid=1&mid=33431345
* 参数说明:
* spid : 合作方标识(我们提供,每个合作方标识不一样)
* mid : 媒资标识代码(经纬cms中的媒资id)
* 返回说明:
* {"code":0,"msg":"ok"}
* code : 0-成功,1001-传入的媒资参数有问题,2001-下线失败
*/
public
function
media_offline
(){
$spid
=
$_GET
[
"spid"
];
$mcode
=
$_GET
[
"mid"
];
$status
=
1
;
$model
=
D
(
"Media"
);
$where
[
"code"
]
=
$mcode
;
$where
[
"sp_id"
]
=
$spid
;
$tmp
=
$model
->
field
(
"id"
)
->
where
(
$where
)
->
find
();
$id
=
$tmp
[
"id"
];
if
(
$id
)
{
//下线云端片库
$data
[
"id"
]
=
$id
;
$data
[
"status"
]
=
$status
;
$data
[
"updatetime"
]
=
date
(
'Y-m-d H:i:s'
);
$r
=
$model
->
save
(
$data
);
//下线酒店片库
$tb
=
"sh_hotel_media_map_
$spid
"
;
$sql
=
"update
$tb
set status=
$status
,updatetime='"
.
$data
[
"updatetime"
]
.
"' where media_id=
$id
"
;
$r
=
M
(
""
)
->
execute
(
$sql
);
if
(
$r
){
$result
[
"code"
]
=
0
;
$result
[
"msg"
]
=
"ok"
;
}
else
{
$result
[
"code"
]
=
2001
;
$result
[
"msg"
]
=
"offline failture!"
;
}
}
else
{
$result
[
"code"
]
=
1001
;
$result
[
"msg"
]
=
"media info unexpect!"
;
}
echo
json_encode
(
$result
);
exit
;
}
/**
* 修改云端片库媒资信息
* 参数:
...
...
@@ -166,10 +213,14 @@ class CenterAction extends Action
* start : 开始时间
* end : 结束时间
* page : 请求页
* page_size : 每页记录数
*/
public
function
incrementList
(){
$page_size
=
10
;
// $page_size = 10;
$page_size
=
$_GET
[
"page_size"
];
if
(
empty
(
$page_size
)){
$page_size
=
10
;
}
$spid
=
$_GET
[
"spid"
];
$start
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$_GET
[
"start"
]));
//date('Y-m-d H:i:s', strtotime($date))
$end
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$_GET
[
"end"
]));
...
...
@@ -183,20 +234,12 @@ class CenterAction extends Action
}
$page_num
=
ceil
(
$total
/
$page_size
);
$limit_from
=
(
$page
-
1
)
*
$page_size
;
// $sql="SELECT mw.code id,mw.title,mw.description,mw.url_play playUrl,mw.url_pic picUrl"
// .",mw.year,mw.type,mw.score,mw.region,mw.actor,mw.director"
// .",h.code hotelId,hm.status,hm.status_inject statusInject"
// ." FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_$spid"
// ." WHERE 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"
// ." JOIN sh_hotel h ON h.id=hm.hotel_id";
$sql
=
"SELECT mw.code id,mw.title,mw.description,mw.programType,mw.url_pic picUrl"
.
",mw.year,mw.type,mw.score,mw.region,mw.actor,mw.director"
.
",h
.code
hotelId,hm.status,hm.status_inject statusInject"
.
",h
m.hotel_id
hotelId,hm.status,hm.status_inject statusInject"
.
" FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_
$spid
"
.
" WHERE 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"
.
" JOIN sh_hotel h ON h.id=hm.hotel_id"
;
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
;
// echo $sql;exit;
$list
=
M
(
""
)
->
query
(
$sql
);
...
...
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