【类 型】:feat

【主	题】:获取用户订单接口
【描	述】:
	[原因]:
	[过程]:
	[影响]:
【结	束】

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

View File

@ -147,4 +147,18 @@ class CheckController extends PublicController
echo json_encode(array('status' => 0, 'msg' => '订单添加失败'));
}
}
/**
* @description: 对应用户的订单列表
*/
public function getOrderList()
{
$where['openid'] = $this->openid;
$where['status'] = array('neq', 'canceled'); //排除已取消的订单
$orderDb = D('order');
if ($orderList = $orderDb->where($where)->select()) {
echo json_encode(array('status' => 1, 'msg' => '访问成功', "orderList" => $orderList));
} else {
echo json_encode(array('status' => 0, 'msg' => '暂无订单数据'));
}
}
}