Commit ade095bf authored by 吴贤德's avatar 吴贤德

中心接口:incrementList测试接口增加hid过滤字段

parent 055d91f6
...@@ -307,10 +307,14 @@ class CenterAction extends Action ...@@ -307,10 +307,14 @@ class CenterAction extends Action
} }
public function test_auto_push(){ public function test_auto_push(){
$data["sp_id"]=1; $json["site_id"]=1;
//sps : [{"sp_id":"1","push_mode":"1"},{"sp_id":"2","push_mode":"0"}]
$json["sps"]=array(array("sp_id"=>1,"push_mode"=>1),array("sp_id"=>2,"push_mode"=>0));
$data["site_id"]=1;
$data["id"]=300; $data["id"]=300;
$data["status"]=2; $data["status"]=2;
$this->media_auto_push($data); $this->media_auto_push($data,$json);
} }
/** /**
...@@ -329,12 +333,17 @@ class CenterAction extends Action ...@@ -329,12 +333,17 @@ class CenterAction extends Action
if (empty($page_size)){ if (empty($page_size)){
$page_size = 10; $page_size = 10;
} }
$whereHotelid = "1=1";
$hid = $_GET["hid"];
if (!empty($hid)){
$whereHotelid = "hotel_id=$hid";
}
$spid = $_GET["spid"]; $spid = $_GET["spid"];
$start = date('Y-m-d H:i:s',strtotime($_GET["start"]));//date('Y-m-d H:i:s', strtotime($date)) $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"])); $end = date('Y-m-d H:i:s',strtotime($_GET["end"]));
$page=$_GET["page"]; $page=$_GET["page"];
$sqlTotal = "SELECT count(1) total FROM sh_hotel_media_map_$spid WHERE hotel_id=3 AND updatetime BETWEEN '$start' AND '$end';"; $sqlTotal = "SELECT count(1) total FROM sh_hotel_media_map_$spid WHERE $whereHotelid AND hm.status_inject=1 AND updatetime BETWEEN '$start' AND '$end';";
$totalArr = M("")->query($sqlTotal); $totalArr = M("")->query($sqlTotal);
$total = 0; $total = 0;
if (count($totalArr)>0){ if (count($totalArr)>0){
...@@ -350,7 +359,7 @@ class CenterAction extends Action ...@@ -350,7 +359,7 @@ class CenterAction extends Action
. ",mw.newsImage_1,mw.newsImage_2,mw.newsImage_3,mw.englishTitle"; . ",mw.newsImage_1,mw.newsImage_2,mw.newsImage_3,mw.englishTitle";
$sql = "SELECT $fields" $sql = "SELECT $fields"
. " FROM (SELECT hm.media_id,h.code,hm.status,hm.status_inject FROM sh_hotel_media_map_$spid hm,sh_hotel h" . " FROM (SELECT hm.media_id,h.code,hm.status,hm.status_inject FROM sh_hotel_media_map_$spid hm,sh_hotel h"
. " WHERE hm.hotel_id=3 AND hm.status_inject=1 AND hm.updatetime BETWEEN '$start' AND '$end' AND h.id=hm.hotel_id ORDER BY hm.updatetime,hm.media_id ASC LIMIT $limit_from,$page_size) hm" . " WHERE $whereHotelid AND hm.status_inject=1 AND hm.updatetime BETWEEN '$start' AND '$end' AND h.id=hm.hotel_id ORDER BY hm.updatetime,hm.media_id ASC LIMIT $limit_from,$page_size) hm"
. " JOIN sh_media_wasu mw ON mw.id=hm.media_id"; . " JOIN sh_media_wasu mw ON mw.id=hm.media_id";
// echo $sql;exit; // echo $sql;exit;
...@@ -361,6 +370,7 @@ class CenterAction extends Action ...@@ -361,6 +370,7 @@ class CenterAction extends Action
$result["page_num"]=(int)$page_num; $result["page_num"]=(int)$page_num;
$result["list"] = $list; $result["list"] = $list;
header('Content-type: application/json'); //json
echo json_encode($result); echo json_encode($result);
exit; exit;
} }
......
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