|
- <?php
- /*
- Author:XM
- Compeny:Spiders Travel
- */
- //酒店产品上下架和非物理删除功能
- require_once __DIR__.'/../Common/Mysql.php';
- if (ALLOW_ORIGIN)
- header("Access-Control-Allow-Origin:*");
- $prod_id=isset($_POST['prod_id'])?$_POST['prod_id']:'';
- $method=isset($_POST['method'])?$_POST['method']:'';
- $added=isset($_POST['added'])?$_POST['added']:'';
- if($prod_id =='' || $method=='' ||$added===''){
- echo json_encode(array("errcode"=>2,"errinfo"=>"参数不能为空"));
- exit;
- }
- $userid=getUserId();
- if ($userid ===false){
- echo json_encode(array("errcode"=>1,"errinfo"=>"用户未登录"));
- exit;
- }
- $pdo=conn();
- if(is_object($pdo)){
- $sql="CALL HT_PROD_DELETE(".$userid.",'".$prod_id."',".$method.",".$added.")";
- writeLog("hotel_prod_del.php HT_PROD_DELETE()::sql::".$sql);
- $result=$pdo->query($sql);
- $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
-
- }
- if (is_array($rowset[0])){
- writeLog("hotel_prod_del.php HT_PROD_DELETE()::".json_encode($rowset[0]));
- echo json_encode($rowset[0]);
- }
- exit;
|