diff --git a/FlyCube/MpApi/Controller/PlaneController.class.php b/FlyCube/MpApi/Controller/PlaneController.class.php index 6c213a6..50a24c3 100644 --- a/FlyCube/MpApi/Controller/PlaneController.class.php +++ b/FlyCube/MpApi/Controller/PlaneController.class.php @@ -526,7 +526,7 @@ class PlaneController extends PublicController } } /** - * @description: 改变订单状态或退款字段 不处理 已取消 未付款 交易关闭的订单 + * @description: 只处理 主状态 为 已付款 的订单 */ public function questAss() { @@ -539,9 +539,8 @@ class PlaneController extends PublicController $orderDb = D('order'); $field = array('status', 'back', 'openid'); $order = $orderDb->where($where)->field($field)->find(); - //不处理订单状态处于 已取消 未付款 交易关闭的情况 - //不处理订单退款状态处于 主动退款 已退款 拒绝退款的状况 - if ($order['status'] == 'canceled' || $order['status'] == 'unpaid' || $order['status'] == 'closed' || $order['back'] == 'actively' || $order['back'] == 'rejected' || $order['back'] == 'rejected' || $order['back'] == 'refunded') { + //只处理主状态已付款的订单 其他状态跳出 + if ($order['main_status'] != '已付款') { echo json_encode(array('status' => 0, 'msg' => '参数有误')); exit(); } @@ -550,14 +549,16 @@ class PlaneController extends PublicController exit(); } //操作数据库 - if ($_REQUEST['state'] == 'status') { - $data['status'] = $_REQUEST['val']; //改变订单状态 - } elseif ($_REQUEST['state'] == 'back') { - $data['back'] = $_REQUEST['val']; //改变订单状态 + if ($_REQUEST['state'] == 'main_status') { + $data['main_status'] = $_REQUEST['val']; + } elseif ($_REQUEST['state'] == 'shipment_status') { + $data['shipment_status'] = $_REQUEST['val']; + } elseif ($_REQUEST['state'] == 'refund_status') { + $data['refund_status'] = $_REQUEST['val']; } if ($orderDb->where($where)->save($data)) { //修改数据 $topicPrefix = makeTopicPrefix($order['openid']); //小程序端用户订阅主题的前缀 ps:订单对应的用户的openid算出来的 - // 提醒小程序端 刷新订单列表 + // 提醒小程序端 刷新订单列表(mqtt) $this->publish('refreshOrderList/' . $topicPrefix, 1); echo json_encode(array('status' => 1, 'msg' => '订单修改成功')); } else {