Ver código fonte

主订单查询优化

dev
nizongfeng 3 anos atrás
pai
commit
54ce9f2fb7
2 arquivos alterados com 43 adições e 10 exclusões
  1. +20
    -0
      application/admin/service/OrderMainService.php
  2. +23
    -10
      application/admin/view/order_main/index.html

+ 20
- 0
application/admin/service/OrderMainService.php Ver arquivo

@@ -308,6 +308,26 @@ class OrderMainService
if (!empty($param['endMoney']) && !empty($param['startMoney'])) {
$where['total_amount'] = ["between",[$param['startMoney'],$param['endMoney']]];
}
//成本区间查询
if (!empty($param['startCost'])&& empty($param['endCost'])) {
$where['cost_amount'] = [">=",$param['startCost']];
}
if (!empty($param['endCost']) && empty($param['startCost'])) {
$where['cost_amount'] = ["<=",$param['endCost']];
}
if (!empty($param['endCost']) && !empty($param['startCost'])) {
$where['cost_amount'] = ["between",[$param['startCost'],$param['endCost']]];
}
//利润区间查询
if (!empty($param['startProfit'])&& empty($param['endProfit'])) {
$where['profit_amount'] = [">=",$param['startProfit']];
}
if (!empty($param['endProfit']) && empty($param['startProfit'])) {
$where['profit_amount'] = ["<=",$param['endProfit']];
}
if (!empty($param['endProfit']) && !empty($param['startProfit'])) {
$where['profit_amount'] = ["between",[$param['startProfit'],$param['endProfit']]];
}
//时间区间查询
if (!empty($param['startTime']) && empty($param['endTime'])) {
$where['create_time'] = [">=",$param['startTime']." 00:00:00"];


+ 23
- 10
application/admin/view/order_main/index.html Ver arquivo

@@ -31,10 +31,12 @@
:value="item.id">
</el-option>
</el-select>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>用户名</span>
<el-input v-model="search.user_name" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
<span>手机号</span>
<el-input v-model="search.user_phone" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>渠道订单号:</span>
<el-input v-model="search.channel_order_no" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
<span>渠道:</span>
@@ -64,14 +66,6 @@
:value="item.id">
</el-option>
</el-select>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>手机号</span>
<el-input v-model="search.user_phone" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
<span>金额</span>
<el-input-number v-model="search.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
~
<el-input-number v-model="search.endMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
<span>时间</span>
<el-date-picker
style="width: 150px;"
@@ -88,6 +82,21 @@
type="date"
placeholder="选择日期">
</el-date-picker>
</div>
<div class="header-search" style="width: 100%;margin-bottom: 10px">
<span>金额</span>
<el-input-number v-model="search.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
~
<el-input-number v-model="search.endMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
<span>成本</span>
<el-input-number v-model="search.startCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
~
<el-input-number v-model="search.endCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
<span>利润</span>
<el-input-number v-model="search.startProfit" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
~
<el-input-number v-model="search.endProfit" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>

<el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
<el-button type="primary" icon="el-icon-plus" @click="addShow=true" >新增</el-button>
</div>
@@ -260,6 +269,10 @@
"create_id":"",
"startMoney":"",
"endMoney":"",
"startCost":"",
"endCost":"",
"startProfit":"",
"endProfit":"",
"startTime":"",
"endTime":"",
"pageNum":1,


Carregando…
Cancelar
Salvar