diff --git a/application/admin/dao/PaymentOrderDao.php b/application/admin/dao/PaymentOrderDao.php index 58b77a8..3d96663 100644 --- a/application/admin/dao/PaymentOrderDao.php +++ b/application/admin/dao/PaymentOrderDao.php @@ -10,6 +10,8 @@ namespace app\admin\dao; use app\admin\command\Util; +use app\admin\model\OrderHotel; +use app\admin\model\OrderItem; use app\admin\model\PaymentOrder; use think\Db; use think\Exception; @@ -117,6 +119,25 @@ class PaymentOrderDao { try { $where = ["a.del_flag"=>0,"a.group_id"=>$param['group_id']]; + if (!empty($param['order_id'])) { + $idList = []; + $orderItemModel = new OrderItem(); + $orderItem = $orderItemModel->where(["id"=>$param['order_id']])->find(); + if ($orderItem != null && !empty($orderItem['payment_order_id'])) { + $idList[] = $orderItem['payment_order_id']; + } + $orderHotelModel = new OrderHotel(); + $orderHotel = $orderHotelModel->where(["id"=>$param['order_id']])->find(); + if ($orderHotel != null && !empty($orderHotel['payment_order_id'])) { + $idList[] = $orderHotel['payment_order_id']; + } + if (count($idList) == 0) { + $where["a.id"]=0; + }else{ + $where["a.id"]=["in",$idList]; + } + } + if (!empty($param['name'])) { $where['a.name'] = ["like","%".$param['name']."%"]; } diff --git a/application/admin/dao/ReceiptOrderDao.php b/application/admin/dao/ReceiptOrderDao.php index 1879618..ecf6b37 100644 --- a/application/admin/dao/ReceiptOrderDao.php +++ b/application/admin/dao/ReceiptOrderDao.php @@ -116,8 +116,18 @@ class ReceiptOrderDao */ public function getList($param) { + try { $where = ["a.del_flag"=>0,"a.group_id"=>$param['group_id']]; + if (empty($param['order_id'])) { + $orderMainModel = new OrderMain(); + $orderMain = $orderMainModel->where(["id"=>$param['order_id']])->select()->find(); + if ($orderMain == null || empty($orderMain['receipt_order_id'])) { + $where["a.id"] = 0; + }else{ + $where["a.id"] = $orderMain['receipt_order_id']; + } + } if (!empty($param['name'])) { $where['a.name'] = ["like","%".$param['name']."%"]; } diff --git a/application/admin/view/payment_order/index.html b/application/admin/view/payment_order/index.html index 50ec1c6..d061833 100755 --- a/application/admin/view/payment_order/index.html +++ b/application/admin/view/payment_order/index.html @@ -33,6 +33,8 @@