allocatr/application/admin/controller/statistics/Item.php
2025-05-12 17:53:19 +08:00

73 lines
1.5 KiB
PHP

<?php
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\admin\model\OrderReview;
use app\common\controller\Backend;
use PDOStatement;
use think\Collection;
use think\Exception;
use think\exception\DbException;
use think\Loader;
use think\response\Json;
use function Symfony\Component\Clock\now;
/**
* 服务项目统计
*
* @icon fa fa-circle-o
*/
class Item extends Backend
{
protected $relationSearch = true;
public function _initialize()
{
parent::_initialize();
}
public function index()
{
return $this->fetch('index');
}
public function list(){
$build = new Order();
$start = now()->modify('-14 days')->format('Y-m-d');
$end_at = now()->format('Y-m-d 23:29:59');
$filter ['daterange'] = request()->get('daterange');
if (!empty($filter['daterange'])) {
$arr = explode(' - ', $filter['daterange']);
if (trim($arr[0])) {
$start = trim($arr[0]);
}
if (trim($arr[1])) {
$end_at = trim($arr[1]) . ' 23:29:59';
}
}
$build->field([
'item_title',
'sum(total) total',
'count(id) count',
'sum(performance) performance'
])->group('item_title');
return [];
}
public function chartData(){
return [];
}
}