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
1176070c
Commit
1176070c
authored
Jul 16, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
b3c7210c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
13 deletions
+49
-13
CenterAction.class.php
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
+30
-9
FrontAction.class.php
SooonerHotel/App/Lib/Action/Api/FrontAction.class.php
+12
-4
LogPushModel.class.php
SooonerHotel/App/Lib/Model/LogPushModel.class.php
+7
-0
No files found.
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
View file @
1176070c
...
...
@@ -88,6 +88,7 @@ class CenterAction extends Action
$data
[
'status'
]
=
intval
(
$json
[
"status"
]);
$data
[
"_starttime"
]
=
$this
->
null2str
(
$json
[
"startTime"
]);
$data
[
"_updatetime"
]
=
$this
->
null2str
(
$json
[
"updateTime"
]);
$data
[
"programType"
]
=
$json
[
"programType"
];
$model
=
D
(
"Media"
);
$tmp
=
$model
->
field
(
"id"
)
->
where
(
"code='"
.
$data
[
'code'
]
.
"'"
)
->
find
();
...
...
@@ -155,9 +156,9 @@ class CenterAction extends Action
// echo $sql;exit;
$list
=
M
(
""
)
->
query
(
$sql
);
$result
[
"total"
]
=
$total
;
$result
[
"page_cur"
]
=
$page
;
$result
[
"page_num"
]
=
$page_num
;
$result
[
"total"
]
=
(
int
)
$total
;
$result
[
"page_cur"
]
=
(
int
)
$page
;
$result
[
"page_num"
]
=
(
int
)
$page_num
;
$result
[
"list"
]
=
$list
;
echo
json_encode
(
$result
);
...
...
@@ -236,7 +237,7 @@ class CenterAction extends Action
if
(
$url
!=
""
&&
$key
!=
""
)
{
$limit_from
=
(
$page
-
1
)
*
$page_size
;
$sql
=
"SELECT mw.code id,mw.title,mw.description,mw.
url_play playUrl
,mw.url_pic picUrl"
$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"
.
" FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_
$spid
"
...
...
@@ -244,13 +245,21 @@ class CenterAction extends Action
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
.
" JOIN sh_hotel h ON h.id=hm.hotel_id"
;
echo
$sql
;
exit
;
//
echo $sql;exit;
$list
=
M
(
""
)
->
query
(
$sql
);
//获取增量媒资列表
$json
=
json_encode
(
$list
);
// $json = json_encode($list,JSON_UNESCAPED_UNICODE);// php >= 5.4
$json
=
json_encode
(
$list
);
//请求合作方接口将变更列表推送
$sw_time
=
time
();
$sw_sign
=
md5
(
$sw_time
.
$json
.
$key
);
$api_push
=
$url
.
"?sw_time=&sw_sign=
$sw_sign
"
;
$sw_sign
=
md5
(
$sw_time
.
$key
);
$api_push
=
$url
.
"?sw_time=
$sw_time
&sw_sign=
$sw_sign
"
;
// echo $api_push;
// echo "<br/>";
// echo $sw_time . $key;
// echo "<br/>";
// echo $json;
// exit;
$data
=
$this
->
HttpPost
(
$api_push
,
$json
);
$jsonR
=
json_decode
(
$data
,
true
);
...
...
@@ -265,13 +274,25 @@ class CenterAction extends Action
$result
[
"code"
]
=
0
;
}
else
{
$result
[
"code"
]
=
2001
;
$result
[
"msg"
]
=
"合作方接口调用异常:"
.
$
jsonR
[
"msg"
]
;
$result
[
"msg"
]
=
"合作方接口调用异常:"
.
$
data
;
}
}
else
{
$result
[
"code"
]
=
1001
;
$result
[
"msg"
]
=
"合作方配置不完整"
;
}
if
(
$result
[
"code"
]
!=
0
){
$log
[
"sp_id"
]
=
$spid
;
$log
[
"starttime"
]
=
$start
;
$log
[
"endtime"
]
=
$end
;
$log
[
"page"
]
=
$page
;
$log
[
"req_json"
]
=
$rawData
;
$log
[
"resp_json"
]
=
$data
;
$log
[
"code"
]
=
$result
[
"code"
];
D
(
"LogPush"
)
->
add
(
$log
);
}
echo
json_encode
(
$result
);
}
...
...
SooonerHotel/App/Lib/Action/Api/FrontAction.class.php
View file @
1176070c
...
...
@@ -37,6 +37,14 @@ class FrontAction extends Action
foreach
(
$arr
as
$item
){
$config
[
"configs"
][
$item
[
"k"
]]
=
$item
[
"v"
];
}
// //待扩展配置(后期增加到数据库后可以注释掉)
// $config["configs"]["front_media_sync_seconds"]="300";
// $config["configs"]["front_gslb_expire_seconds"]="600";
// $config["configs"]["front_play_expire_seconds"]="21600";
// $config["configs"]["front_media_inject_limit"]="5120";
// $config["configs"]["front_media_inject_concurrent"]="1";
// //end
//设备
$sql
=
"SELECT device.code,device.type,device.ip,device.port,device.virtual_ip,device.netcard,storage.path,storage.size"
.
" FROM sh_hotel_device device,sh_hotel_device_storage storage"
...
...
@@ -90,7 +98,7 @@ class FrontAction extends Action
$page_num
=
ceil
(
$total
/
$page_size
);
$limit_from
=
(
$page
-
1
)
*
$page_size
;
$sql
=
"SELECT mw.code,mw.url_play,hm.status,hm.status_inject"
$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 ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
;
...
...
@@ -98,9 +106,9 @@ class FrontAction extends Action
$list
=
M
(
""
)
->
query
(
$sql
);
$result
[
"total"
]
=
$total
;
$result
[
"page_cur"
]
=
$page
;
$result
[
"page_num"
]
=
$page_num
;
$result
[
"total"
]
=
(
int
)
$total
;
$result
[
"page_cur"
]
=
(
int
)
$page
;
$result
[
"page_num"
]
=
(
int
)
$page_num
;
$result
[
"list"
]
=
$list
;
echo
json_encode
(
$result
);
...
...
SooonerHotel/App/Lib/Model/LogPushModel.class.php
0 → 100644
View file @
1176070c
<?php
class
LogPushModel
extends
RelationModel
{
protected
$tableName
=
'sh_log_push'
;
//推送记录表
}
\ 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