【类 型】:chore

【主	题】:获取订单接口修改
【描	述】:
	[原因]:前端订单列表需要 bind_route 即站点绑定的航线字段
	[过程]:把站点列表里面关联的 bind_route一并取出来
	[影响]:
【结	束】

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

View File

@ -717,9 +717,22 @@ class AdminController extends PublicController
if ($this->tokenShop_id != C('powerId')) { if ($this->tokenShop_id != C('powerId')) {
$where['shop_id'] = $this->tokenShop_id; //非总管理员 只返回自己的账户信息 $where['shop_id'] = $this->tokenShop_id; //非总管理员 只返回自己的账户信息
} }
$orderDb = D('order'); $orderDb = D('order');
if ($orderList = $orderDb->where($where)->select()) { $where = [];
echo json_encode(array('status' => 1, 'msg' => '访问成功', "orderList" => $orderList)); if ($this->tokenShop_id != C('powerId')) {
$where['shop_id'] = $this->tokenShop_id;
}
$orderList = $orderDb
->alias('o') // 别名为 o
->join('receive_site rs ON o.receive_site_id = rs.id') // 关联 receive_site 表
->field('o.*, rs.bind_route') // 选择字段,包括 bind_route
->where($where)
->select();
if ($orderList) {
echo json_encode(array('status' => 1, 'msg' => '访问成功', 'orderList' => $orderList));
} else { } else {
echo json_encode(array('status' => 0, 'msg' => '暂无订单数据')); echo json_encode(array('status' => 0, 'msg' => '暂无订单数据'));
} }