【类 型】:fix

【主	题】:修改 飞机控制端 设置订单状态接口
【描	述】:
	[原因]:数据库订单表  数据接口调整
	[过程]:修改函数的字段 的键值等
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-21 19:23:19 +08:00
parent 28ef6da15e
commit 88030c0580

View File

@ -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 {