TicketCount.php
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* @remark :
* @name :TicketCount.php
* @author :lyh
* @method :post
* @time :2025/8/7 17:42
*/
namespace App\Console\Commands\Ticket;
use App\Models\Manage\ManageHr;
use App\Models\Ticket\TicketDailyManageCount;
use Illuminate\Console\Command;
class TicketCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ticket_count {action}';
/**
* The console command description.
*
* @var string
*/
protected $description = '日统计工单';
/**
* @remark :统计脚本
* @name :handle
* @author :lyh
* @method :post
* @time :2025/8/7 17:45
*/
public function handle(){
}
/**
* @remark :按管理员统计(只统计技术组)
* @name :manage_action
* @author :lyh
* @method :post
* @time :2025/8/7 17:45
*/
public function manage_action(){
$manageHrModel = new ManageHr();
$manageList = $manageHrModel->list(['status'=>1,'dept_id'=>1],'id',['id','name','nickname']);
$date = date('Y-m-d');
$ticketManageCountModel = new TicketDailyManageCount();
foreach ($manageList as $item){
$data = [
'date'=>$date,
'manage_id'=>$item['id'],
'manage_name'=>$item['name'],
'ticket_num'=>'',//工单总数量
'average_time'=>'',//平均完成工单时长
'fastest_time'=>'',//最快完成工单时间
'timeout_num'=>'',//超时工单数量
'complete_num'=>'',//完成工单数量
];
//查询当前用户是否当日已有记录
$ticketManageInfo = $ticketManageCountModel->read(['date'=>$date,'manage_id'=>$item['id']],['id']);
if($ticketManageInfo === false){
//TODO::执行新增
}else{
//TODO::执行编辑
}
}
}
}