sth
This commit is contained in:
parent
4946ca4526
commit
df63a6c89f
|
|
@ -3,6 +3,7 @@
|
|||
namespace app\admin\controller\statistics;
|
||||
|
||||
use app\admin\model\Admin;
|
||||
use app\admin\model\Aftersale;
|
||||
use app\admin\model\Order;
|
||||
use app\admin\model\OrderDispatch;
|
||||
use app\common\controller\Backend;
|
||||
|
|
@ -57,14 +58,50 @@ class Worker extends Backend
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if (false === $this->request->isAjax()) {
|
||||
$appkey = config('map.baidu_app_key');
|
||||
$this->assign('mapkey',$appkey);
|
||||
|
||||
$count = \app\admin\model\Worker::count();
|
||||
$active_count = \app\admin\model\Worker::where('location_update_time', '>=', date('Y-m-d H:i:s', strtotime('-30 days')))
|
||||
->count();
|
||||
|
||||
$add_count_1 = \app\admin\model\Worker::where('create_time', '>=', date('Y-m-d'))
|
||||
->count();
|
||||
|
||||
$active_count_7 = \app\admin\model\Worker::where('create_time', '>=', date('Y-m-d H:i:s', strtotime('-7 days')))
|
||||
->count();
|
||||
|
||||
$this->assign('count',$count);
|
||||
$this->assign('active_count',$active_count);
|
||||
$this->assign('add_count_1',$add_count_1);
|
||||
$this->assign('add_count_7',$active_count_7);
|
||||
|
||||
//待接单
|
||||
$todo_count = OrderDispatch::where('status',OrderDispatch::STATUS_TOGET)->count();
|
||||
//进行中
|
||||
$ing_count = OrderDispatch::whereIn('status',[OrderDispatch::STATUS_GOTIT,OrderDispatch::STATUS_PLANIT,OrderDispatch::STATUS_CLOCK])->count();
|
||||
//待验收
|
||||
$check_count = OrderDispatch::where('status',Order::STATUS_CHECKING)->count();
|
||||
//售后待处理
|
||||
$aftersale_count = Aftersale::where('status',1)->count();
|
||||
|
||||
$this->assign('todo_count',$todo_count);
|
||||
$this->assign('ing_count',$ing_count);
|
||||
$this->assign('check_count',$check_count);
|
||||
$this->assign('aftersale_count',$aftersale_count);
|
||||
|
||||
//师傅坐标
|
||||
$list = \app\admin\model\Worker::where('lng','>',0)->field(['lng','lat'])->select();
|
||||
$arr = [];
|
||||
foreach ($list as $item){
|
||||
$arr[] = [
|
||||
$item->lng, $item->lat,
|
||||
];
|
||||
}
|
||||
$this->assign('locationData',json_encode($arr));
|
||||
return $this->view->fetch();
|
||||
}
|
||||
//如果发送的来源是 Selectpage,则转发到 Selectpage
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@
|
|||
<div class="sm-st clearfix">
|
||||
<span class="sm-st-icon st-blue"><i class="fa fa-users"></i></span>
|
||||
<div class="sm-st-info">
|
||||
<span>100/10</span>
|
||||
<span>{$count}/{$active_count}</span>
|
||||
师傅总数/活跃数
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -199,8 +199,8 @@
|
|||
<div class="sm-st clearfix">
|
||||
<span class="sm-st-icon st-green"><i class="fa fa-users"></i></span>
|
||||
<div class="sm-st-info">
|
||||
<span>100</span>
|
||||
今日新增
|
||||
<span>{$add_count_1}/{$add_count_7}</span>
|
||||
今日新增/7天新增
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -209,8 +209,8 @@
|
|||
<div class="sm-st clearfix">
|
||||
<span class="sm-st-icon st-violet"><i class="fa fa-users"></i></span>
|
||||
<div class="sm-st-info">
|
||||
<span>100</span>
|
||||
师傅总数
|
||||
<span>{$todo_count}/{$ing_count}/{$check_count}</span>
|
||||
待接单/进行中/待验收
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -219,12 +219,11 @@
|
|||
<div class="sm-st clearfix">
|
||||
<span class="sm-st-icon st-red"><i class="fa fa-users"></i></span>
|
||||
<div class="sm-st-info">
|
||||
<span>100</span>
|
||||
师傅总数
|
||||
<span>{$aftersale_count}</span>
|
||||
待处理售后
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -253,6 +252,10 @@
|
|||
<!-- 最后加载百度地图并回调 -->
|
||||
<!-- 加载百度地图 GL -->
|
||||
<script>
|
||||
|
||||
const rawDataStr = '{$locationData}';
|
||||
// 先解析成数组
|
||||
const rawData = JSON.parse(rawDataStr);
|
||||
window.initMap = function () {
|
||||
const map = new BMapGL.Map("bar-chart");
|
||||
map.centerAndZoom(new BMapGL.Point(104.0665, 30.5728), 6);
|
||||
|
|
@ -262,7 +265,7 @@
|
|||
const view = new mapvgl.View({ map });
|
||||
|
||||
// ✅ 写死的点数据(10个城市)
|
||||
const data = [
|
||||
/*const data = [
|
||||
{ geometry: { type: 'Point', coordinates: [116.4074, 39.9042] } }, // 北京
|
||||
{ geometry: { type: 'Point', coordinates: [121.4737, 31.2304] } }, // 上海
|
||||
{ geometry: { type: 'Point', coordinates: [113.2644, 23.1291] } }, // 广州
|
||||
|
|
@ -273,7 +276,14 @@
|
|||
{ geometry: { type: 'Point', coordinates: [106.5516, 29.5630] } }, // 重庆
|
||||
{ geometry: { type: 'Point', coordinates: [108.9480, 34.2632] } }, // 西安
|
||||
{ geometry: { type: 'Point', coordinates: [115.8582, 28.6829] } } // 南昌
|
||||
];
|
||||
];*/
|
||||
|
||||
const data = rawData.map(item => ({
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: item
|
||||
}
|
||||
}));
|
||||
|
||||
// 根据聚合区域内的点数决定颜色(数量多,颜色深)
|
||||
const gradient = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user