Browse Source

接口优化

dev
nizongfeng 3 years ago
parent
commit
9178144154
2 changed files with 9 additions and 10 deletions
  1. +5
    -4
      application/admin/service/PaymentOrderDao.php
  2. +4
    -6
      application/admin/view/payment_order/index.html

+ 5
- 4
application/admin/service/PaymentOrderDao.php View File

@@ -134,14 +134,15 @@ class PaymentOrderDao
->where($where)->count();
$list = $receiptOrder
->alias("a")
->join('hbp_order_hotel b', 'a.id = b.payment_order_id', 'left')
->join('hbp_order_item c', 'a.id = c.payment_order_id', 'left')
->field("a.*,ifnull(GROUP_CONCAT(b.id ORDER BY b.id DESC),'-') hotel_ids,ifnull(sum(b.total_price),'-') hotel_amount,
ifnull(GROUP_CONCAT(c.id ORDER BY c.id DESC),'-') item_ids,ifnull(sum(c.total_price),'-') item_amount")
->field("a.*,
(SELECT concat('订单:',ifnull( GROUP_CONCAT( id ORDER BY id DESC ), '-' ), '</br>金额:',ifnull( sum( total_price ), '-' )) from hbp_order_item where payment_order_id = a.id) 'item',
(SELECT concat('订单:',ifnull( GROUP_CONCAT( id ORDER BY id DESC ), '-' ), '</br>金额:',ifnull( sum( total_price ), '-' )) from hbp_order_hotel where payment_order_id = a.id) 'hotel'
")
->group("a.id")
->where($where)
->limit($offset, $param['pageSize'])
->order("a.id","DESC")->select();

$data = ["total" => $total, "list" => $list->toArray()];
return Util::returnArrSu("", $data);
} catch (Exception $e) {


+ 4
- 6
application/admin/view/payment_order/index.html View File

@@ -38,16 +38,14 @@
</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="130">
<template slot-scope="scope">
<div v-html="'酒店:'+scope.row.hotel_ids"></div>
<div v-html="'附加项目:'+scope.row.item_ids"></div>
<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="130">
<template slot-scope="scope">
<div v-html="'酒店:'+scope.row.hotel_amount"></div>
<div v-html="'附加项目:'+scope.row.item_amount"></div>
<div v-html="scope.row.item"></div>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="80"></el-table-column>


Loading…
Cancel
Save