【类 型】:
【原 因】: 【过 程】: 【影 响】:
This commit is contained in:
parent
d4f120db78
commit
3909feb9f2
@ -804,16 +804,18 @@ class AdminController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 获取订单列表(只拿已付款 和已退款但是发货状态为 已发货 订单列表) 链表查询还有关联的站点列表的 bind_route runing字段一并取出
|
* @description: 获取订单列表(只拿已付款和已退款但发货状态为已发货的订单),并联查 receive_site 表 bind_route、runing 字段
|
||||||
*/
|
*/
|
||||||
public function getPaidOrderList()
|
public function getPaidOrderList()
|
||||||
{
|
{
|
||||||
if ($this->tokenShop_id != C('powerId')) {
|
if ($this->tokenShop_id != C('powerId')) {
|
||||||
$where['o.shop_id'] = $this->tokenShop_id; // 非总管理员只返回自己的账户信息
|
$where['o.shop_id'] = $this->tokenShop_id; // 非总管理员只返回自己的订单
|
||||||
}
|
}
|
||||||
|
|
||||||
$orderDb = D('order');
|
$orderDb = D('order');
|
||||||
// 构建查询条件
|
$prefix = C('DB_PREFIX'); // 获取表前缀
|
||||||
|
|
||||||
|
// 构建复合查询条件
|
||||||
$where['_complex'] = array(
|
$where['_complex'] = array(
|
||||||
'_logic' => 'or',
|
'_logic' => 'or',
|
||||||
array('o.main_status' => '已付款'),
|
array('o.main_status' => '已付款'),
|
||||||
@ -822,11 +824,12 @@ class AdminController extends PublicController
|
|||||||
'o.shipment_status' => '已发货'
|
'o.shipment_status' => '已发货'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 执行查询
|
||||||
$paidOrderList = $orderDb
|
$paidOrderList = $orderDb
|
||||||
->alias('o') // 别名为 o
|
->alias('o')
|
||||||
->join('lr_receive_site rs ON o.receive_site_id = rs.id') // 关联 lr_receive_site 表
|
->join("{$prefix}receive_site rs ON o.receive_site_id = rs.id") // 动态表前缀
|
||||||
->field('o.id,o.
|
->field("o.id,o.shop_id,o.order_sn,o.food_sn,o.total_weight,o.total_num,o.total_price,o.transport_price,o.pack_price,o.apply_price,o.receiver,o.tel,o.by_plane_id,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.paid_time,o.refundapply_time,o.refundagree_time,o.received_time,o.shipped_time, rs.bind_route, rs.runing")
|
||||||
shop_id,o.order_sn,o.food_sn,o.total_weight,o.total_num,o.total_price,transport_price,pack_price,o.apply_price,o.receiver,o.tel,o.by_plane_id,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.paid_time,o.refundapply_time,o.refundagree_time,o.received_time,o.shipped_time, rs.bind_route, rs.runing') // 选择字段,包括 bind_route 和 runing
|
|
||||||
->where($where)
|
->where($where)
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
@ -836,6 +839,7 @@ class AdminController extends PublicController
|
|||||||
echo json_encode(array('status' => 0, 'msg' => '暂无订单数据'));
|
echo json_encode(array('status' => 0, 'msg' => '暂无订单数据'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 获取订单列表
|
* @description: 获取订单列表
|
||||||
*/
|
*/
|
||||||
|
@ -88,7 +88,7 @@ class PlaneController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 删除指定飞机
|
* @description: 删除指定机型
|
||||||
*/
|
*/
|
||||||
public function deletePlaneClass()
|
public function deletePlaneClass()
|
||||||
{
|
{
|
||||||
@ -115,23 +115,37 @@ class PlaneController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 获取 飞机列表
|
|
||||||
*/
|
|
||||||
public function getAirList()
|
public function getAirList()
|
||||||
{
|
{
|
||||||
|
$airDb = D('airplane');
|
||||||
|
|
||||||
if ($this->tokenShop_id != C('powerId')) { // 非总管理员
|
if ($this->tokenShop_id != C('powerId')) { // 非总管理员
|
||||||
$where['shop_id'] = $this->tokenShop_id;
|
$where['shop_id'] = $this->tokenShop_id;
|
||||||
}
|
}
|
||||||
$where['del'] = "0";
|
$where['del'] = '0';
|
||||||
$airListDb = D('airplane_register');
|
|
||||||
$field = array('id', 'name', 'macadd', 'describe', 'shop_id', 'apply_time', 'onoff', 'del');
|
$field = 'a.id, a.name, a.class_id, a.shop_id, a.status, c.class_name, c.wheelbase, c.category, c.weight_max';
|
||||||
if ($airList = $airListDb->where($where)->field($field)->select()) {
|
$prefix = C('DB_PREFIX');
|
||||||
echo json_encode(array('status' => 1, 'msg' => '访问成功', "airList" => $airList));
|
|
||||||
|
$airList = $airDb
|
||||||
|
->alias('a')
|
||||||
|
->join("LEFT JOIN {$prefix}airplane_class c ON a.class_id = c.id")
|
||||||
|
->where($where)
|
||||||
|
->field($field)
|
||||||
|
->order('a.id desc')
|
||||||
|
->select();
|
||||||
|
|
||||||
|
if ($airList) {
|
||||||
|
echo json_encode(array(
|
||||||
|
'status' => 1,
|
||||||
|
'msg' => '访问成功',
|
||||||
|
'airList' => $airList
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(array('status' => 0, 'msg' => '暂无飞机数据'));
|
echo json_encode(array('status' => 0, 'msg' => '暂无飞机数据'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 创建新飞机
|
* @description: 创建新飞机
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user