Accept Merge Request #118: (feature/zy -> develop)

Merge Request: feature: kpi dash

Created By: @zhuyu
Accepted By: @zhuyu
URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/118
This commit is contained in:
zhuyu 2025-06-05 23:29:59 +08:00 committed by Coding
commit 6045d93716
3 changed files with 42 additions and 6 deletions

View File

@ -219,7 +219,42 @@ class Dashboard extends Backend
return $this->view->fetch('kpi_dispatch');
}
if ($groupId == 10) {
if ($groupId == 2) {
$build = new \app\admin\model\Order();
$start = date('Y-m-01 00:00:00');
$end_at = date('Y-m-t 23:59:59');
$build->whereBetween('create_time', [$start, $end_at]);
$data = $build->field([
'admin_id',
'count(id) total',
'count(if(status=60,1,null)) finish',
'sum(if(status=60,performance,null)) money',
])->group('admin_id')
->where('admin_id', $this->auth->id)
->find();
//total 派单数
//money 利润
$money = $data['money'] ?? 0;
$mymoney = $money * 3 / 100;
$assignData = [
'total' => $data['total'] ?? 0,
'finish' => $data['finish'] ?? 0,
'money' => $data['money'] ?? 0,
'rate' => $money,
'my_money' => $mymoney,
];
$admin = Admin::get($this->auth->id);
$this->view->assign('adminname', $admin['username']);
$this->view->assign('data', $assignData);
return $this->view->fetch('kpi_presale');
}

View File

@ -4,6 +4,7 @@
</div>
<div class="panel-body">
<div class="row">
<h1>当前岗位暂不支持</h1>
</div>
</div>
</div>

View File

@ -18,11 +18,11 @@
</thead>
<tbody>
<tr>
<td>111</td>
<td>22</td>
<td>33</td>
<td>44</td>
<td>55</td>
<td>{$adminname|htmlentities}</td>
<td>{$data['total']|htmlentities}</td>
<td>{$data['money']|htmlentities}</td>
<td>3%</td>
<td>{$data['my_money']|htmlentities}</td>
</tr>
</tbody>
</table>