You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
1006 B

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. //酒店产品上下架和非物理删除功能
  7. require_once __DIR__.'/../Common/Mysql.php';
  8. if (ALLOW_ORIGIN)
  9. header("Access-Control-Allow-Origin:*");
  10. $prod_id=isset($_POST['prod_id'])?$_POST['prod_id']:'';
  11. $method=isset($_POST['method'])?$_POST['method']:'';
  12. $added=isset($_POST['added'])?$_POST['added']:'';
  13. if($prod_id =='' || $method=='' ||$added===''){
  14. echo json_encode(array("errcode"=>2,"errinfo"=>"参数不能为空"));
  15. exit;
  16. }
  17. $userid=getUserId();
  18. if ($userid ===false){
  19. echo json_encode(array("errcode"=>1,"errinfo"=>"用户未登录"));
  20. exit;
  21. }
  22. $pdo=conn();
  23. if(is_object($pdo)){
  24. $sql="CALL HT_PROD_DELETE(".$userid.",'".$prod_id."',".$method.",".$added.")";
  25. writeLog("hotel_prod_del.php HT_PROD_DELETE()::sql::".$sql);
  26. $result=$pdo->query($sql);
  27. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  28. }
  29. if (is_array($rowset[0])){
  30. writeLog("hotel_prod_del.php HT_PROD_DELETE()::".json_encode($rowset[0]));
  31. echo json_encode($rowset[0]);
  32. }
  33. exit;