Browse Source

检索优化

master
nizongfeng 1 year ago
parent
commit
890c504972
2 changed files with 33 additions and 17 deletions
  1. +19
    -7
      application/admin/dao/PaymentOrderDao.php
  2. +14
    -10
      application/admin/view/payment_order/index.html

+ 19
- 7
application/admin/dao/PaymentOrderDao.php View File

@@ -119,17 +119,29 @@ class PaymentOrderDao
{
try {
$where = ["a.del_flag"=>0,"a.group_id"=>$param['group_id']];
if (!empty($param['order_id'])) {
if (!empty($param['order_id']) || !empty($param['sub_order_id'])) {
$subWhere = [];
if (!empty($param['order_id'])) {
$subWhere["order_id"]=$param['order_id'];
}
if (!empty($param['sub_order_id'])) {
$subWhere["id"]=$param['sub_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'];
$orderItemList = $orderItemModel->where($subWhere)->select()->toArray();
foreach ($orderItemList as $orderItem) {
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'];
$orderHotelList = $orderHotelModel->where($subWhere)->select()->toArray();
foreach ($orderHotelList as $orderHotel) {
if ($orderHotel != null && !empty($orderHotel['payment_order_id'])) {
$idList[] = $orderHotel['payment_order_id'];
}
}
if (count($idList) == 0) {
$where["a.id"]=0;


+ 14
- 10
application/admin/view/payment_order/index.html View File

@@ -33,8 +33,10 @@
</el-select>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>订单ID:</span>
<span>订单ID:</span>
<el-input v-model="search.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>子订单ID:</span>
<el-input v-model="search.sub_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>
~
@@ -48,7 +50,7 @@
<el-table-column prop="create_id" label="创建人" min-width="70" :formatter="getUserName"></el-table-column>
<el-table-column prop="id" label="付款单号" min-width="50"></el-table-column>
<el-table-column prop="name" label="付款单名称" min-width="120"></el-table-column>
<el-table-column prop="status" label="付款单状态" :formatter="getStatusName" min-width="150">
<el-table-column prop="status" label="付款单状态" :formatter="getStatusName" min-width="60">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.status" size="mini" @change="setStatus(scope.row)">
<el-radio-button label="0">未付款</el-radio-button>
@@ -57,24 +59,25 @@
</el-radio-group>
</template>
</el-table-column>
<el-table-column prop="order_ids" label="酒店" min-width="130">
<el-table-column prop="order_ids" label="酒店" min-width="220">
<template slot-scope="scope">
<div v-html="scope.row.hotel"></div>
</template>
</el-table-column>
<el-table-column prop="total_amount" label="附加项目" min-width="130">
<el-table-column prop="total_amount" label="附加项目" min-width="220">
<template slot-scope="scope">
<div v-html="scope.row.item"></div>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="80"></el-table-column>
<el-table-column prop="update_time" label="更新时间" min-width="80"></el-table-column>
<el-table-column label="操作" min-width="180">
<el-table-column prop="create_time" label="创建时间" min-width="60"></el-table-column>
<el-table-column prop="update_time" label="更新时间" min-width="60"></el-table-column>
<el-table-column label="操作" min-width="140">
<template slot-scope="scope">
<el-button-group>
<el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit">编辑</el-button>
<el-button type="success" size="mini" @click="editOrderDivShow(scope.row)" icon="el-icon-share">订单</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="delAll(scope.row.id)">删除</el-button>
<el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit" style="margin: 5px;">编辑</el-button>
<el-button type="success" size="mini" @click="editOrderDivShow(scope.row)" icon="el-icon-share" style="margin: 5px;">订单</el-button>
<el-button type="danger" size="mini" v-if="scope.row.status==0" icon="el-icon-delete" @click="delAll(scope.row.id)" style="margin: 5px;">删除</el-button>
<el-button type="danger" size="mini" icon="el-icon-search" @click="" style="margin: 5px;">附件</el-button>
</el-button-group>
</template>
</el-table-column>
@@ -304,6 +307,7 @@
data: function () {
return {
search: {
sub_order_id:"",
order_id:"",
id:"",
create_id:"",


Loading…
Cancel
Save