产品页修改

This commit is contained in:
karl 2024-08-06 18:26:02 +08:00
parent 4805ccf949
commit 705b0690a6
8 changed files with 40 additions and 8 deletions

View File

@ -2,6 +2,15 @@
<div class="app-container">
<div class="filter-container">
<el-date-picker
class="filter-item"
v-model="listQuery.times"
type="datetimerange"
:default-time="['00:00:00', '23:59:59']"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<el-input v-model="listQuery.product_name" placeholder="产品名称" style="width: 200px;" class="filter-item" />
<el-select v-model="listQuery.os_status" placeholder="平台状态" class="filter-item">
<el-option
@ -66,6 +75,18 @@
</template>
</el-table-column>
<el-table-column align="center" label="核销率" width="160">
<template slot-scope="scope">
{{ scope.row.asset_rate }}%
</template>
</el-table-column>
<el-table-column align="center" label="退款率" width="160">
<template slot-scope="scope">
{{ scope.row.refund_rate }}%
</template>
</el-table-column>
</el-table>
<pagination

View File

@ -38,8 +38,8 @@ module.exports = {
},
proxy: {
'/dev-api': { // 接口地址 以 api开头的都走下面的配置
target: 'https://www.szjinao.cn', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
// target: 'http://0.0.0.0:8787', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
// target: 'https://www.szjinao.cn', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
target: 'http://0.0.0.0:8787', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
ws: true, // 是否支持 websocket 请求 支持
changeOrigin: true, // 是否启用跨域
pathRewrite: {

View File

@ -273,6 +273,7 @@ class IndexController extends base
$limit = $request->get('limit', 10);
$product_name = $request->get('product_name');
$os = $request->get('os_status');
$times = $request->get('times');
$list = Orders::where('id','>',0)
->fieldRaw('
os,product_name,
@ -306,11 +307,16 @@ class IndexController extends base
END) AS refund_price
')
->group('os,product_name')
->order('total desc');
->order('all desc');
if ($request->admin->id !=1){
$list = $list->where('admin_id', $request->admin->id);
}
if($times) {
$list = $list->whereBetween('create_at',[strtotime($times[0])*1000,strtotime($times[1])*1000+999]);
}
if (!empty($os)){
$list = $list->where('os',$os);
}
@ -318,7 +324,12 @@ class IndexController extends base
$list = $list->where('product_name','like','%'.$product_name.'%');
}
$list = $list->paginate($limit);
$list = $list->paginate($limit)->toArray();
foreach ($list['data'] as &$item) {
$item['refund_rate'] = bcmul(bcdiv((string)$item['refund'], (string)$item['all'], 4), '100', 2);
$item['asset_rate'] = bcmul(bcdiv((string)$item['asset'], (string)$item['all'], 4), '100', 2);
}
return $this->success($list);
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-93ce0574]{position:relative;padding-bottom:60px}.el-table[data-v-93ce0574],.filter-container[data-v-93ce0574]{padding-bottom:52px}
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-6af90fbe]{position:relative;padding-bottom:60px}.el-table[data-v-6af90fbe],.filter-container[data-v-6af90fbe]{padding-bottom:52px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long