|
- <?php
- /**
- * Created by PhpStorm.
- * User: Steven
- * Date: 2016/8/22
- * Time: 10:12
- */
- require_once '../Api/OrderListServer.php';
- require_once '../Common/Mysql.php';
- $res = getOrderInfo('2016-08-18 00:00:00', '2016-08-23 00:00:00', '', '240336');
- if (!$res) {
- return false;
- } else {
- //var_dump($res['order']);
- if (isset($res['order']['orderStatus'])) {
- $serialId = $res['order']['serialId'];
- $orderStatus = $res['order']['orderStatus'];
- updateOrderInfo($serialId, $orderStatus);
- } else {
- foreach ($res['order'] as $item) {
- $serialId = $item['serialId'];
- $orderStatus = $item['orderStatus'];
- echo $serialId, "--", $orderStatus;
- updateOrderInfo($serialId, $orderStatus);
- }
- }
- }
- /**
- * @param $serialId 订单号
- * @param $orderStatus 订单状态
- * 更新订单状态
- */
- function updateOrderInfo($serialId, $orderStatus)
- { switch ($orderStatus){//N: 新订单未支付,即景区收款 P: 已支付,即平台收款 C:已取消 T:已取票 146出票 147已完成 148已取消
- case 'P':
- $status = 146;
- break;
- case 'T':
- $status = 147;
- break;
- case 'C':
- $status = 148;
- break;
- case 'P':
- $status = 146;
- break;
- default :
- $status =999;
- break;
- }
- $pdo = conn();
- $sql = " update order_main set order_status = ".$status." where order_id = ".$serialId." or parent_order_id =".$serialId;
- $pdo->query($sql);
- //TODO:处理更新订单业务
-
-
- }
|