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.
 
 
 
 

44 lines
1.2 KiB

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. require_once '../Common/Mysql.php';
  7. if (ALLOW_ORIGIN)
  8. header("Access-Control-Allow-Origin:*");
  9. $userid=getUserId();
  10. if ($userid ===false){
  11. echo json_encode(array("code"=>1,"info"=>"未登录"));
  12. exit;
  13. }
  14. $ordid=$_POST['ordid'];
  15. $prod_list=$_POST['prod_list'];
  16. writeLog('change_price.php'.json_encode($_POST));
  17. $pdo=conn();
  18. /* $price_txt = substr($_POST['price'],1,strlen($_POST['price'])-2);
  19. $price_array = explode(",", $price_txt);
  20. $prod_txt_ary = explode("}{",$myprod);
  21. $prod_id_ary = array();
  22. foreach( $prod_txt_ary as $prod_txt ) {
  23. $end_pos = strpos($prod_txt,"p");
  24. $prod_id_ary[] = substr($prod_txt,3,$end_pos-3);
  25. }
  26. $count = count($price_array);
  27. for ($i=0; $i<$count; $i++) {
  28. $price = $price_array[i];
  29. $proid = $prod_id_ary[i];
  30. $sql="call SP_CHANGE_PRICE('".$ordid."','".$price."','".$proid."')";
  31. } */
  32. $sql="call SP_CHANGE_PRICE(".$ordid.",'".$prod_list."')";
  33. //$sql="update order_main set order_price ='".$price_arr[$k]."' where PROD_ID=".$v." and PARENT_ORDER_ID=".$ordid." and RUN_ID>0";
  34. $result=$pdo->query($sql);
  35. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  36. writeLog("change_price.php sql:: ".$sql."::rowset ::".json_encode($rowset));
  37. $result->closeCursor();
  38. echo json_encode($rowset[0]);
  39. exit();