Browse Source

查询检索优化

master
nizongfeng 1 year ago
parent
commit
192b33d447
4 changed files with 39 additions and 2 deletions
  1. +21
    -0
      application/admin/dao/PaymentOrderDao.php
  2. +10
    -0
      application/admin/dao/ReceiptOrderDao.php
  3. +3
    -0
      application/admin/view/payment_order/index.html
  4. +5
    -2
      application/admin/view/receipt_order/index.html

+ 21
- 0
application/admin/dao/PaymentOrderDao.php View File

@@ -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']."%"];
}


+ 10
- 0
application/admin/dao/ReceiptOrderDao.php View File

@@ -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']."%"];
}


+ 3
- 0
application/admin/view/payment_order/index.html View File

@@ -33,6 +33,8 @@
</el-select>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>订单ID:</span>
<el-input v-model="search.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>成本</span>
<el-input-number v-model="search.startCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
~
@@ -302,6 +304,7 @@
data: function () {
return {
search: {
order_id:"",
id:"",
create_id:"",
name: "",


+ 5
- 2
application/admin/view/receipt_order/index.html View File

@@ -34,6 +34,8 @@

</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>订单ID:</span>
<el-input v-model="search.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>金额</span>
<el-input-number v-model="search.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
~
@@ -136,8 +138,6 @@
</el-form>
<div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>订单ID:</span>
<el-input v-model="orderMainListSearch.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>订单状态:</span>
<el-select v-model="orderMainListSearch.order_status" filterable style="width: 150px;" placeholder="请选择" clearable>
<el-option
@@ -191,6 +191,8 @@
</el-select>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>订单号</span>
<el-input v-model="orderMainListSearch.order_id" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
<span>手机号</span>
<el-input v-model="orderMainListSearch.user_phone" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
<span>金额</span>
@@ -274,6 +276,7 @@
data: function () {
return {
search: {
order_id:"",
id:"",
create_id:"",
name: "",


Loading…
Cancel
Save