【类 型】:feat
【主 题】:增加 一个只拿 已付款订单 的接口 【描 述】: [原因]:前端任务执行 只用已付款的数据 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
b1285f0398
commit
7d58f8cd1e
@ -709,6 +709,34 @@ class AdminController extends PublicController
|
||||
echo json_encode(array('status' => 0, 'msg' => '参数有误'));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 获取订单列表(只拿已付款) 链表查询还有关联的站点列表的 bind_route runing字段一并取出
|
||||
*/
|
||||
public function getPaidOrderList()
|
||||
{
|
||||
if ($this->tokenShop_id != C('powerId')) {
|
||||
$where['o.shop_id'] = $this->tokenShop_id; // 非总管理员只返回自己的账户信息
|
||||
}
|
||||
|
||||
$orderDb = D('order');
|
||||
$where = [];
|
||||
if ($this->tokenShop_id != C('powerId')) {
|
||||
$where['o.shop_id'] = $this->tokenShop_id;
|
||||
}
|
||||
$where['o.main_status'] = '已付款';
|
||||
$paidOrderList = $orderDb
|
||||
->alias('o') // 别名为 o
|
||||
->join('lr_receive_site rs ON o.receive_site_id = rs.id') // 关联 lr_receive_site 表
|
||||
->field('o.id,o.shop_id,o.order_sn,o.food_sn,o.total_weight,o.total_num,o.total_price,o.receiver,o.tel,o.receive_site_id,o.receive_site_name,o.remark,o.product_snapshot,o.main_status,o.shipment_status,o.refund_status,o.refund_remark,o.order_time,o.refundapply_time, rs.bind_route, rs.runing') // 选择字段,包括 bind_route 和 runing
|
||||
->where($where)
|
||||
->select();
|
||||
|
||||
if ($paidOrderList) {
|
||||
echo json_encode(array('status' => 1, 'msg' => '访问成功', 'paidOrderList' => $paidOrderList));
|
||||
} else {
|
||||
echo json_encode(array('status' => 0, 'msg' => '暂无订单数据'));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 获取订单列表 链表查询还有关联的站点列表的 bind_route runing字段一并取出
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user