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.
 
 
 
 
 

32 lines
972 B

  1. <?php
  2. require_once "../Common/Config.php";
  3. $openid=$_COOKIE['wxopenid'];
  4. $sql="SP_GET_ORDER_LIST '{$openid}'";
  5. $pdo = new PDO("sqlsrv:Server=".HOST.";Database=".DB, USER, PASSWORD);//5.6版本pdo连接sqlsrv
  6. $result=$pdo->query($sql);
  7. $rowset = $result->fetchAll(PDO::FETCH_ASSOC);
  8. $errcode=$rowset[0]["ERRCODE"];
  9. $data=array(
  10. "code"=>$errcode,
  11. "info"=>$rowset[0]["ERRINFO"]
  12. );
  13. if ($errcode ==0){
  14. foreach ($rowset as $v){
  15. $val=array();
  16. $val["order_no"]=$v["MAIN_ID"];
  17. $val["order_time"]=$v["ORDER_TIME"];
  18. $val["order_status"]=$v["ORDER_STATUS"];
  19. $val["prod_code"]=$v["PROD_CODE"];
  20. $val["prod_name"]=$v["PROD_NAME"];
  21. $val["price"]=$v["PRICE"];
  22. $val["start_area"]=$v["START_AREA"];
  23. $val["end_area"]=$v["END_AREA"];
  24. $val["go_info"]=$v["GO_INFO"];
  25. $val["back_info"]=$v["BACK_INFO"];
  26. $val["direction"]=$v["DIRECTION"];
  27. $val["run_days"]=$v["RUN_DAYS"];
  28. $val["need_pay"]=$v["NEED_PAY"];
  29. $data["order_list"][]=$val;
  30. }
  31. }
  32. echo json_encode($data);