修改
This commit is contained in:
parent
25adfb36fc
commit
41dd493e57
|
|
@ -223,7 +223,7 @@ class Dashboard extends Backend
|
|||
return $this->view->fetch('kpi_presale');
|
||||
}
|
||||
|
||||
$this->error('当前岗位暂未支持');
|
||||
return $this->view->fetch('kpi_admin');
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,13 @@ class Orderplan extends Backend
|
|||
|
||||
public function dashboard()
|
||||
{
|
||||
return $this->fetch('orderplan/index');
|
||||
$start = now()->modify('-14 days')->format('Y-m-d');
|
||||
$end_at = now()->format('Y-m-d');
|
||||
$default_daterange = $start . ' - ' . $end_at;
|
||||
|
||||
return $this->fetch('orderplan/index',[
|
||||
'default_daterange' => $default_daterange
|
||||
]);
|
||||
}
|
||||
|
||||
public function data()
|
||||
|
|
@ -144,7 +150,7 @@ class Orderplan extends Backend
|
|||
private function getPie()
|
||||
{
|
||||
$build = new OrderAbnormal();
|
||||
$res = $this->buildDate($build)
|
||||
$res = $this->buildDate($build,name:'create_time')
|
||||
->field([
|
||||
'abnormal_title name',
|
||||
'count(id) value',
|
||||
|
|
@ -212,7 +218,7 @@ class Orderplan extends Backend
|
|||
}
|
||||
|
||||
|
||||
private function buildDate($build, $table_name = null)
|
||||
private function buildDate($build, $table_name = null,$name = 'audit_time')
|
||||
{
|
||||
$start = now()->modify('-14 days')->format('Y-m-d');
|
||||
$end_at = now()->format('Y-m-d 23:29:59');
|
||||
|
|
@ -228,9 +234,9 @@ class Orderplan extends Backend
|
|||
}
|
||||
// dd([$start, $end_at]);
|
||||
if ($table_name) {
|
||||
$build->where($table_name . '.create_time', 'between', [$start, $end_at]);
|
||||
$build->where($table_name . '.'.$name, 'between', [$start, $end_at]);
|
||||
} else {
|
||||
$build->where('create_time', 'between', [$start, $end_at]);
|
||||
$build->where($name, 'between', [$start, $end_at]);
|
||||
|
||||
}
|
||||
return $build;
|
||||
|
|
|
|||
|
|
@ -29,12 +29,18 @@ class Aftersale extends Backend
|
|||
->order('pid', 'asc')
|
||||
->order('sort', 'desc')
|
||||
->select();
|
||||
|
||||
$start = now()->modify('-30 days')->format('Y-m-d');
|
||||
$end_at = now()->format('Y-m-d');
|
||||
$default_daterange = $start . ' - ' . $end_at;
|
||||
|
||||
$tree = $this->buildTree($items);
|
||||
$formattedTree = $this->formatTree($tree);
|
||||
|
||||
$this->items = $items;
|
||||
$this->itemsformattedTree = $formattedTree;
|
||||
$this->view->assign("items", $formattedTree);
|
||||
$this->view->assign("default_daterange", $default_daterange);
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,12 @@ class Item extends Backend
|
|||
|
||||
public function index()
|
||||
{
|
||||
return $this->fetch('index');
|
||||
$start = now()->modify('-7 days')->format('Y-m-d');
|
||||
$end_at = now()->format('Y-m-d');
|
||||
$default_daterange = $start . ' - ' . $end_at;
|
||||
return $this->fetch('index',[
|
||||
'default_daterange' => $default_daterange
|
||||
]);
|
||||
}
|
||||
|
||||
public function list()
|
||||
|
|
@ -63,7 +68,7 @@ class Item extends Backend
|
|||
}
|
||||
|
||||
|
||||
$build->whereBetween('create_time', [$start, $end_at])
|
||||
$build->whereBetween('audit_time', [$start, $end_at])
|
||||
->field([
|
||||
'item_title name', // 类型
|
||||
'sum(total) total', // 营业额
|
||||
|
|
@ -140,7 +145,7 @@ class Item extends Backend
|
|||
}
|
||||
}
|
||||
|
||||
$res = $build->whereBetween('create_time', [$start, $end_at])
|
||||
$res = $build->whereBetween('audit_time', [$start, $end_at])
|
||||
->where('status', Order::STATUS_FINISHED)
|
||||
->field([
|
||||
'item_title name', // 类型
|
||||
|
|
|
|||
9
application/admin/view/dashboard/kpi_admin.html
Normal file
9
application/admin/view/dashboard/kpi_admin.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<div class="panel panel-default panel-intro">
|
||||
<div class="panel-heading">
|
||||
<h1>KPI面板</h1>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<!-- 单选:维度 -->
|
||||
<!-- 时间范围 -->
|
||||
<div class="form-group" style="margin-left: 15px;">
|
||||
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 180px;">
|
||||
<input type="text" class="form-control datetimerange" value = "{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 180px;">
|
||||
</div>
|
||||
|
||||
<!-- 查询按钮 -->
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@
|
|||
<div id="chart-filter-table" style="margin-top:20px;margin-bottom: 30px;">
|
||||
<div style="display: flex;position: relative" class="col-sm-6 row">
|
||||
<input type="text" style="max-width: 200px" class="form-control mr-2" id="keyword" placeholder="名称/电话号码" >
|
||||
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
<input type="text" class="form-control datetimerange" value="{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
placeholder="指定日期" name="filter[daterange]" id="daterange-table" autocomplete="off" style="width: 180px;">
|
||||
<button class="btn btn-default ml-2" id="first-search">查询</button>
|
||||
</div>
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
<input id="area_id" style="display: none" class="form-control" name="area_id" hidden type="text" />
|
||||
</div>
|
||||
|
||||
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
<input type="text" class="form-control datetimerange" value="{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
placeholder="指定日期" name="filter[daterange]" id="daterange-table2" autocomplete="off" style="position: absolute;left: 320px;width: 180px;">
|
||||
<button class="btn btn-default ml-2" id="first-search2" style="position: absolute;left: 500px;">查询</button>
|
||||
</div>
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
</div>
|
||||
<input type="text" id="item_id_value" style="display: none" name="row[item_id]">
|
||||
<input type="text" class="form-control datetimerange ml-2" style="max-width: 200px" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
placeholder="指定日期" name="filter[daterange]" id="daterange-table3" autocomplete="off" >
|
||||
placeholder="指定日期" name="filter[daterange]" value="{$default_daterange}" id="daterange-table3" autocomplete="off" >
|
||||
<button class="btn btn-default ml-2" id="first-search3">查询</button>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
|
|
@ -237,7 +237,7 @@
|
|||
<div id="chart-filter-table4" style="margin-top:20px;margin-bottom: 30px;">
|
||||
<div style="display: flex;position: relative" class="col-sm-6 row">
|
||||
<input type="text" style="max-width: 200px" class="form-control mr-2" id="keyword4" placeholder="名称/电话号码" >
|
||||
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
<input type="text" class="form-control datetimerange" value="{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
placeholder="指定日期" name="filter[daterange]" id="daterange-table4" autocomplete="off" style="width: 180px;">
|
||||
<button class="btn btn-default ml-2" id="first-search4">查询</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="form-inline" id="chart-filter" style="margin-top:20px;margin-bottom: 30px;">
|
||||
<!-- 时间范围 -->
|
||||
<div class="form-group" style="margin-left: 15px;">
|
||||
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 200px;">
|
||||
<input type="text" class="form-control datetimerange" value = "{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 200px;">
|
||||
</div>
|
||||
|
||||
<!-- 查询按钮 -->
|
||||
|
|
@ -50,6 +50,7 @@
|
|||
</div>
|
||||
<div style="display: inline-block;width: 200px;position: relative">
|
||||
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
|
||||
value = "{$default_daterange}"
|
||||
placeholder="指定日期" name="filter[daterange]" id="daterange-table" autocomplete="off" style="width: 180px;">
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user