正在显示
5 个修改的文件
包含
108 行增加
和
6 行删除
| @@ -18,7 +18,7 @@ class FetchTicketProjects extends Command | @@ -18,7 +18,7 @@ class FetchTicketProjects extends Command | ||
| 18 | * | 18 | * |
| 19 | * @var string | 19 | * @var string |
| 20 | */ | 20 | */ |
| 21 | - protected $signature = 'workorder:fetch-ticket-projects {action}'; | 21 | + protected $signature = 'workorder:fetch-Ticket-projects {action}'; |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * The console command description. | 24 | * The console command description. |
| @@ -179,7 +179,7 @@ class LoginController extends BaseController | @@ -179,7 +179,7 @@ class LoginController extends BaseController | ||
| 179 | $accessToken = $wechat->getAccessToken(); | 179 | $accessToken = $wechat->getAccessToken(); |
| 180 | $data = $wechat->setQrcode('global-v6_'.$this->param['type'].'_'.$this->param['id'],$accessToken); | 180 | $data = $wechat->setQrcode('global-v6_'.$this->param['type'].'_'.$this->param['id'],$accessToken); |
| 181 | if(!empty($data)){ | 181 | if(!empty($data)){ |
| 182 | - $data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".$data['ticket']; | 182 | + $data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?Ticket=".$data['Ticket']; |
| 183 | } | 183 | } |
| 184 | $this->response('success',Code::SUCCESS,$data); | 184 | $this->response('success',Code::SUCCESS,$data); |
| 185 | } | 185 | } |
| @@ -218,11 +218,11 @@ class LoginController extends BaseController | @@ -218,11 +218,11 @@ class LoginController extends BaseController | ||
| 218 | */ | 218 | */ |
| 219 | public function getWechatLoginInfo(){ | 219 | public function getWechatLoginInfo(){ |
| 220 | $this->param = $this->request->validate([ | 220 | $this->param = $this->request->validate([ |
| 221 | - 'ticket' => 'required', | 221 | + 'Ticket' => 'required', |
| 222 | ],[ | 222 | ],[ |
| 223 | - 'ticket.required' => 'ticket不能为空', | 223 | + 'Ticket.required' => 'ticket不能为空', |
| 224 | ]); | 224 | ]); |
| 225 | - $info = Cache::get($this->param['ticket']); | 225 | + $info = Cache::get($this->param['Ticket']); |
| 226 | $this->response('success',Code::SUCCESS,$info); | 226 | $this->response('success',Code::SUCCESS,$info); |
| 227 | } | 227 | } |
| 228 | 228 |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TicketController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/8/11 10:46 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Bside\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Bside\BaseController; | ||
| 14 | +use App\Http\Logic\Bside\Ticket\TicketLogic; | ||
| 15 | +use App\Models\WorkOrder\Tickets; | ||
| 16 | +use Illuminate\Http\Request; | ||
| 17 | + | ||
| 18 | +class TicketController extends BaseController | ||
| 19 | +{ | ||
| 20 | + public function __construct(Request $request) | ||
| 21 | + { | ||
| 22 | + parent::__construct($request); | ||
| 23 | + $this->logic = new TicketLogic(); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * @remark :统计记录(今日) | ||
| 28 | + * @name :ticketCount | ||
| 29 | + * @author :lyh | ||
| 30 | + * @method :post | ||
| 31 | + * @time :2025/8/11 10:47 | ||
| 32 | + */ | ||
| 33 | + public function ticketCount(){ | ||
| 34 | + $data['daily'] = $this->logic->getTicketCount(); | ||
| 35 | + $data['list'] = $this->logic->getDailyTicketCount(); | ||
| 36 | + $this->response('success',Code::SUCCESS,$data); | ||
| 37 | + } | ||
| 38 | +} |
app/Http/Logic/Bside/Ticket/TicketLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TicketLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/8/11 10:54 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Bside\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Bside\BaseLogic; | ||
| 13 | +use App\Models\Ticket\TicketDailyCount; | ||
| 14 | +use App\Models\Ticket\TicketDailyDeptCount; | ||
| 15 | +use App\Models\Ticket\TicketDailyManageCount; | ||
| 16 | +use App\Models\WorkOrder\Tickets; | ||
| 17 | +use Illuminate\Support\Carbon; | ||
| 18 | + | ||
| 19 | +class TicketLogic extends BaseLogic | ||
| 20 | +{ | ||
| 21 | + public function __construct() | ||
| 22 | + { | ||
| 23 | + parent::__construct(); | ||
| 24 | + $this->param = $this->requestAll; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * @remark :获取今日统计数据 | ||
| 29 | + * @name :getTicketCount | ||
| 30 | + * @author :lyh | ||
| 31 | + * @method :post | ||
| 32 | + * @time :2025/8/11 10:54 | ||
| 33 | + */ | ||
| 34 | + public function getTicketCount(){ | ||
| 35 | + $data = []; | ||
| 36 | + $ticketModel = new Tickets(); | ||
| 37 | + $data['ticket_num'] = $ticketModel->count();//工单总数 | ||
| 38 | + $date = date('Y-m-d');//今日时间 | ||
| 39 | + $data['add_num'] = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日新增工单 | ||
| 40 | + $data['processed_num'] = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日已处理工单 | ||
| 41 | + $data['untreated_num'] = $ticketModel->counts(['end_at'=>null]);//今日未处理工单 | ||
| 42 | + return $this->success($data); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * @remark :按日统计数据 | ||
| 47 | + * @name :getDailyTicketCount | ||
| 48 | + * @author :lyh | ||
| 49 | + * @method :post | ||
| 50 | + * @time :2025/8/11 10:57 | ||
| 51 | + */ | ||
| 52 | + public function getDailyTicketCount(){ | ||
| 53 | + $dailyModel = new TicketDailyCount(); | ||
| 54 | + $dailyList = $dailyModel->list([],'average_time',['*'],'desc',5);//取最近5条数据 | ||
| 55 | + $date = Carbon::yesterday()->toDateString(); //昨日时间 | ||
| 56 | + $manageModel = new TicketDailyManageCount(); | ||
| 57 | + $manageList = $manageModel->list(['date'=>$date],'average_time',['*'],'desc',5);//取最近5条数据 | ||
| 58 | + $deptModel = new TicketDailyDeptCount(); | ||
| 59 | + $deptList = $deptModel->list(['date'=>$date],'average_time',['*'],'desc',5); | ||
| 60 | + $data = ['daily'=>$dailyList,'manage'=>$manageList,'dept'=>$deptList]; | ||
| 61 | + return $this->success($data); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | +} |
| @@ -27,7 +27,7 @@ class MessagePush extends Base | @@ -27,7 +27,7 @@ class MessagePush extends Base | ||
| 27 | 27 | ||
| 28 | const TYPE_INQUIRY = 'inquiry'; | 28 | const TYPE_INQUIRY = 'inquiry'; |
| 29 | const TYPE_WEEK = 'week'; | 29 | const TYPE_WEEK = 'week'; |
| 30 | - const TYPE_TICKET = 'ticket'; | 30 | + const TYPE_TICKET = 'Ticket'; |
| 31 | //设置关联表名 | 31 | //设置关联表名 |
| 32 | /** | 32 | /** |
| 33 | * @var mixed | 33 | * @var mixed |
-
请 注册 或 登录 后发表评论