Commit 21d2c0ff authored by 吴贤德's avatar 吴贤德

API: 修复媒资拉取和自动转推重复问题

parent 99ddaea2
......@@ -56,17 +56,6 @@ class CenterAction extends Action
* url : 华数媒资详情url
*/
public function media_update(){
// http://115.29.7.64:8092/XmlData/incrementJson?date=20190625&version=20190625150313
//{"actor":"安娜·舒若希基娜,伊万·阿赫洛贝斯金,加林娜·秋宁娜,德米特里·纳吉耶夫,莉莎·阿尔扎马索娃"
//,"description":""
//,"id":"2018239"
//,"md5":"a3e0d11328e0feb3114921851f39ac41"
//,"picUrl":"http://localhost:8080/cms/cms_images/www224/2015-08/10/1439187356969_393049.jpg"
//,"playUrl":"http://downloader.media.wasu.tv/data13/ott/344/2015-08/10/e0a341ae74eb62574a7d4070686f07df/5d148f9d/1439187357125_958916.ts"
//,"programType":"儿童动漫","region":"欧美","score":"8.7","startTime":"2015-08-10 14:16:46"
//,"status":"1","title":"冰雪女王","type":"movie","updateTime":"2015-11-27 10:06:17","year":"2012"}
// $url="http://115.29.7.64:8092/XmlData/incrementJson?date=20190625&version=20190625150313";
$rawData = @file_get_contents("php://input");
//echo $rawData."\n";
$json = json_decode($rawData,true);
......@@ -84,7 +73,7 @@ class CenterAction extends Action
$data['description'] = $json["description"];
$data['url_play'] = $json["playUrl"];
$data['url_pic'] = $json["picUrl"];
$data['year'] = $json["year"];
$data['year'] = substr($json["year"],0,4);
$data['score'] = floatval($json["score"]);
$data['region'] = $json["region"];
$data['actor'] = $json["actor"];
......@@ -98,7 +87,9 @@ class CenterAction extends Action
$data["sp_id"]=intval($spid);
$model = D("Media");
$tmp = $model->field("id")->where("code='".$data['code']."'")->find();
$where["code"]=$data["code"];
$where["sp_id"]=$data["sp_id"];
$tmp = $model->field("id")->where($where)->find();
$id= $tmp["id"];
// var_dump($tmp);exit;
if($id){
......@@ -147,7 +138,7 @@ class CenterAction extends Action
$sql ="SELECT h.id,hm.media_id FROM sh_hotel h"
." LEFT JOIN (SELECT media_id,hotel_id FROM sh_hotel_media_map_$sp_id WHERE media_id=$media_id) hm ON h.id=hm.hotel_id"
." WHERE media_id IS NULL;";
." WHERE h.sp_id=$sp_id AND media_id IS NULL;";
$arr = M("")->query($sql);
// var_dump($arr);
......
......@@ -10,6 +10,7 @@ class ToolAction extends Action
{
/*
* 获取媒资对应的所有分前端的gslb地址
* http://api.hotel.wasu.tv/Api/Tool/make_gslb_url?sp_id=9&media_id=1556323
* 参数 :
* sp_id = id
* media_id = code
......@@ -17,6 +18,8 @@ class ToolAction extends Action
* 签名 :MD5(request_uri(不包含sw_sign)KEY),sw_sign必须放在最后面,key由平台提供
*/
public function make_gslb_url(){
$sp_id = $_GET["sp_id"];
$mcode=$_GET["media_id"];
$sw_time=time();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment