Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
12 个修改的文件
包含
132 行增加
和
19 行删除
| @@ -87,6 +87,9 @@ class CountProject extends Command | @@ -87,6 +87,9 @@ class CountProject extends Command | ||
| 87 | //剩余服务时常 | 87 | //剩余服务时常 |
| 88 | $arr['service_day'] = $projectInfo['remain_day']; | 88 | $arr['service_day'] = $projectInfo['remain_day']; |
| 89 | $arr = $this->inquiry($arr,$domain, $project_id,$projectInfo['is_upgrade'] ?? 0); | 89 | $arr = $this->inquiry($arr,$domain, $project_id,$projectInfo['is_upgrade'] ?? 0); |
| 90 | + if($arr === false){ | ||
| 91 | + continue; | ||
| 92 | + } | ||
| 90 | //查询当天数据是否存在 存在则更新 | 93 | //查询当天数据是否存在 存在则更新 |
| 91 | $info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]); | 94 | $info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]); |
| 92 | if($info === false){ | 95 | if($info === false){ |
| @@ -146,7 +149,7 @@ class CountProject extends Command | @@ -146,7 +149,7 @@ class CountProject extends Command | ||
| 146 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ | 149 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ |
| 147 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); | 150 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); |
| 148 | if($inquiry_list == false){ | 151 | if($inquiry_list == false){ |
| 149 | - return false; | 152 | + return $arr; |
| 150 | } | 153 | } |
| 151 | // echo date('Y-m-d H:i:s') . '拉取询盘状态:' .json_encode($inquiry_list) . PHP_EOL; | 154 | // echo date('Y-m-d H:i:s') . '拉取询盘状态:' .json_encode($inquiry_list) . PHP_EOL; |
| 152 | if($inquiry_list['status'] == self::STATUS_ERROR){ | 155 | if($inquiry_list['status'] == self::STATUS_ERROR){ |
| @@ -113,12 +113,32 @@ class GeoQuestionRes extends Command | @@ -113,12 +113,32 @@ class GeoQuestionRes extends Command | ||
| 113 | } | 113 | } |
| 114 | // 命中文案 | 114 | // 命中文案 |
| 115 | $hit_data[] = $result['text']; | 115 | $hit_data[] = $result['text']; |
| 116 | + | ||
| 116 | if(!empty($result['annotations'])){ | 117 | if(!empty($result['annotations'])){ |
| 117 | $url = array_column(array_column($result['annotations'], 'url_citation'), 'url'); | 118 | $url = array_column(array_column($result['annotations'], 'url_citation'), 'url'); |
| 118 | $title = array_column(array_column($result['annotations'], 'url_citation'), 'title'); | 119 | $title = array_column(array_column($result['annotations'], 'url_citation'), 'title'); |
| 119 | $hit_data = array_merge($url, $title, $hit_data); | 120 | $hit_data = array_merge($url, $title, $hit_data); |
| 120 | } | 121 | } |
| 121 | $hit = 0; | 122 | $hit = 0; |
| 123 | + //todo::与预期结果是否复合 | ||
| 124 | + if(!empty($taskInfo['expect_result'])){ | ||
| 125 | + $str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否"; | ||
| 126 | + $strResult = $geo_service->getChatResult($str, 'gpt-4o-mini'); | ||
| 127 | + if(isset($strResult['text']) && !empty($strResult['text'])){ | ||
| 128 | + switch ($strResult['text']){ | ||
| 129 | + case '是': | ||
| 130 | + $is_match = 1; | ||
| 131 | + $hit++; | ||
| 132 | + break; | ||
| 133 | + case '否': | ||
| 134 | + $is_match = 2; | ||
| 135 | + break; | ||
| 136 | + default: | ||
| 137 | + $is_match = 0; | ||
| 138 | + break; | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + } | ||
| 122 | $hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data); | 142 | $hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data); |
| 123 | if (!empty($hit_keyword['keywords'])) { | 143 | if (!empty($hit_keyword['keywords'])) { |
| 124 | $hit++; | 144 | $hit++; |
| @@ -144,6 +164,7 @@ class GeoQuestionRes extends Command | @@ -144,6 +164,7 @@ class GeoQuestionRes extends Command | ||
| 144 | 'hit' => $hit ?? 0, | 164 | 'hit' => $hit ?? 0, |
| 145 | 'keywords_num'=>$keyword_num ?? [], | 165 | 'keywords_num'=>$keyword_num ?? [], |
| 146 | 'url_num'=>$url_num ?? [], | 166 | 'url_num'=>$url_num ?? [], |
| 167 | + 'is_match'=>$is_match ?? 0, | ||
| 147 | 'created_at'=>date('Y-m-d H:i:s'), | 168 | 'created_at'=>date('Y-m-d H:i:s'), |
| 148 | 'updated_at'=>date('Y-m-d H:i:s'), | 169 | 'updated_at'=>date('Y-m-d H:i:s'), |
| 149 | ]; | 170 | ]; |
| @@ -294,6 +315,17 @@ class GeoQuestionRes extends Command | @@ -294,6 +315,17 @@ class GeoQuestionRes extends Command | ||
| 294 | } | 315 | } |
| 295 | 316 | ||
| 296 | /** | 317 | /** |
| 318 | + * @remark :预期结果对比 | ||
| 319 | + * @name :getExpectResult | ||
| 320 | + * @author :lyh | ||
| 321 | + * @method :post | ||
| 322 | + * @time :2025/8/12 13:51 | ||
| 323 | + */ | ||
| 324 | + public function getExpectResult($question,$answer,$expect){ | ||
| 325 | + $str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否"; | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + /** | ||
| 297 | * 获取待执行任务ID | 329 | * 获取待执行任务ID |
| 298 | * @return mixed | 330 | * @return mixed |
| 299 | */ | 331 | */ |
| @@ -50,17 +50,22 @@ class lyhDemo extends Command | @@ -50,17 +50,22 @@ class lyhDemo extends Command | ||
| 50 | protected $description = '更新路由'; | 50 | protected $description = '更新路由'; |
| 51 | 51 | ||
| 52 | public function handle(){ | 52 | public function handle(){ |
| 53 | - echo 'start.'. PHP_EOL; | ||
| 54 | - $ticketModel = new Tickets(); | ||
| 55 | - $list = $ticketModel->list(['id'=>['!=',0]],'id',['id','plan_end_at']); | ||
| 56 | - foreach ($list as $item){ | ||
| 57 | - echo '执行数据id:'.$item['id'].PHP_EOL; | ||
| 58 | - $ticketLogModel = new TicketLog(); | ||
| 59 | - $ticketLogModel->edit(['plan_end_at'=>$item['plan_end_at']],['ticket_id'=>$item['id']]); | ||
| 60 | - } | 53 | + return $this->getExpectResult(); |
| 61 | return true; | 54 | return true; |
| 62 | } | 55 | } |
| 63 | 56 | ||
| 57 | + public function getExpectResult(){ | ||
| 58 | + $geo_service = new GeoService(); | ||
| 59 | + $question = 'Top AI Coffee Robot'; | ||
| 60 | + $answer = "Top AI Coffee Robot\" refers to advanced robotic systems that combine **precision automation, artificial intelligence, and specialty coffee expertise** to create high-quality beverages with minimal human intervention. Here's a breakdown of key features, leading examples, and benefits:\n\n### Core Features of Top AI Coffee Robots:\n1. **AI-Driven Customization** \n - Analyzes user preferences (strength, milk type, sweetness) via app profiles or voice commands. \n - Learns from feedback to refine future orders (e.g., \"less bitter than last time\"). \n2. **Robotic Precision Brewing** \n - Industrial arms handle grinding, tamping, steaming milk, and latte art with sub-millimeter accuracy. \n - Sensors monitor temperature, extraction time, and pressure for optimal flavor."; | ||
| 61 | + $expect = "While I don't have specific information on the RobotAnno coffee machine, in general"; | ||
| 62 | + $str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否"; | ||
| 63 | + $data = $geo_service->getChatResult($str, 'gpt-4o-mini'); | ||
| 64 | + if(isset($data['text']) && $data['text'] == '是'){ | ||
| 65 | + | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | + | ||
| 64 | /** | 69 | /** |
| 65 | * @remark :查看路由是否为空 | 70 | * @remark :查看路由是否为空 |
| 66 | * @name :_actionRoute | 71 | * @name :_actionRoute |
| @@ -19,6 +19,7 @@ use App\Models\WorkOrder\TicketProject; | @@ -19,6 +19,7 @@ use App\Models\WorkOrder\TicketProject; | ||
| 19 | use App\Models\WorkOrder\Tickets; | 19 | use App\Models\WorkOrder\Tickets; |
| 20 | use Illuminate\Console\Command; | 20 | use Illuminate\Console\Command; |
| 21 | use Illuminate\Support\Carbon; | 21 | use Illuminate\Support\Carbon; |
| 22 | +use Illuminate\Support\Facades\DB; | ||
| 22 | use Illuminate\Support\Facades\Log; | 23 | use Illuminate\Support\Facades\Log; |
| 23 | 24 | ||
| 24 | class TicketCount extends Command | 25 | class TicketCount extends Command |
| @@ -75,6 +76,7 @@ class TicketCount extends Command | @@ -75,6 +76,7 @@ class TicketCount extends Command | ||
| 75 | $date = Carbon::yesterday()->toDateString(); // 昨日时间 | 76 | $date = Carbon::yesterday()->toDateString(); // 昨日时间 |
| 76 | $ticketManageCountModel = new TicketDailyManageCount(); | 77 | $ticketManageCountModel = new TicketDailyManageCount(); |
| 77 | foreach ($manageList as $item){ | 78 | foreach ($manageList as $item){ |
| 79 | + $average_time = ''; | ||
| 78 | $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']); | 80 | $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']); |
| 79 | $ticketLogModel = new TicketLog(); | 81 | $ticketLogModel = new TicketLog(); |
| 80 | $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]); | 82 | $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]); |
| @@ -128,6 +130,7 @@ class TicketCount extends Command | @@ -128,6 +130,7 @@ class TicketCount extends Command | ||
| 128 | $ticketDailyDeptModel = new TicketDailyDeptCount(); | 130 | $ticketDailyDeptModel = new TicketDailyDeptCount(); |
| 129 | $date = Carbon::yesterday()->toDateString(); // "2025-08-07" | 131 | $date = Carbon::yesterday()->toDateString(); // "2025-08-07" |
| 130 | foreach ($groupList as $item){ | 132 | foreach ($groupList as $item){ |
| 133 | + $average_time = ''; | ||
| 131 | $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']); | 134 | $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']); |
| 132 | $manageIdArr = $manageHrModel->selectField(['belong_group'=>$item['id'],'status'=>1,'dept_id'=>1],'manage_id'); | 135 | $manageIdArr = $manageHrModel->selectField(['belong_group'=>$item['id'],'status'=>1,'dept_id'=>1],'manage_id'); |
| 133 | $ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]); | 136 | $ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]); |
| @@ -140,7 +143,7 @@ class TicketCount extends Command | @@ -140,7 +143,7 @@ class TicketCount extends Command | ||
| 140 | 'dept_id'=>$item['id'], | 143 | 'dept_id'=>$item['id'], |
| 141 | 'dept_name'=>$item['name'], | 144 | 'dept_name'=>$item['name'], |
| 142 | 'ticket_num'=>$ticket_num ?? 0, | 145 | 'ticket_num'=>$ticket_num ?? 0, |
| 143 | - 'average_time'=>$average_time ?? 0 | 146 | + 'average_time'=>$average_time ?? '' |
| 144 | ]; | 147 | ]; |
| 145 | $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']); | 148 | $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']); |
| 146 | if($deptInfo === false){ | 149 | if($deptInfo === false){ |
| @@ -173,6 +176,13 @@ class TicketCount extends Command | @@ -173,6 +176,13 @@ class TicketCount extends Command | ||
| 173 | $processed_num = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]); | 176 | $processed_num = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]); |
| 174 | $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side'); | 177 | $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side'); |
| 175 | $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side'); | 178 | $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side'); |
| 179 | + $dbResult = DB::table('gl_ticket_projects as p')->leftJoin('gl_tickets as t', 'p.id', '=', 't.project_id') | ||
| 180 | + ->select( | ||
| 181 | + 'p.project_cate', | ||
| 182 | + DB::raw('COUNT(t.id) as ticket_count') | ||
| 183 | + ) | ||
| 184 | + ->groupBy('p.project_cate') | ||
| 185 | + ->pluck('ticket_count', 'project_cate'); | ||
| 176 | $data = [ | 186 | $data = [ |
| 177 | 'date' => $date, | 187 | 'date' => $date, |
| 178 | 'ticket_num'=>$ticket_num, | 188 | 'ticket_num'=>$ticket_num, |
| @@ -181,6 +191,7 @@ class TicketCount extends Command | @@ -181,6 +191,7 @@ class TicketCount extends Command | ||
| 181 | 'processed_num'=>$processed_num, | 191 | 'processed_num'=>$processed_num, |
| 182 | 'average_time'=>$average_time ?? '', | 192 | 'average_time'=>$average_time ?? '', |
| 183 | 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true), | 193 | 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true), |
| 194 | + 'source_type'=>json_encode($dbResult,true) | ||
| 184 | ]; | 195 | ]; |
| 185 | $ticketDailyModel = new TicketDailyCount(); | 196 | $ticketDailyModel = new TicketDailyCount(); |
| 186 | $ticketDailyInfo = $ticketDailyModel->read(['date'=>$date],['id']); | 197 | $ticketDailyInfo = $ticketDailyModel->read(['date'=>$date],['id']); |
| @@ -37,7 +37,7 @@ class BaseController extends Controller | @@ -37,7 +37,7 @@ class BaseController extends Controller | ||
| 37 | $info = Cache::get(Common::MANAGE_TOKEN . $this->token); | 37 | $info = Cache::get(Common::MANAGE_TOKEN . $this->token); |
| 38 | if(!empty($this->token) && !empty($info)){ | 38 | if(!empty($this->token) && !empty($info)){ |
| 39 | $this->manage = $info; | 39 | $this->manage = $info; |
| 40 | - Cache::put(Common::MANAGE_TOKEN . $this->token, $info, 3600 * 6);//更新缓存时间 | 40 | + Cache::put(Common::MANAGE_TOKEN . $this->token, $info, 3600 * 12);//更新缓存时间 |
| 41 | $this->uid = $info['id']; | 41 | $this->uid = $info['id']; |
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| @@ -32,6 +32,7 @@ class TicketController extends BaseController | @@ -32,6 +32,7 @@ class TicketController extends BaseController | ||
| 32 | public function ticketCount(){ | 32 | public function ticketCount(){ |
| 33 | $data['daily'] = $this->logic->getTicketCount(); | 33 | $data['daily'] = $this->logic->getTicketCount(); |
| 34 | $data['list'] = $this->logic->getDailyTicketCount(); | 34 | $data['list'] = $this->logic->getDailyTicketCount(); |
| 35 | + $data['ticket'] = $this->logic->getTicketList(); | ||
| 35 | $this->response('success',Code::SUCCESS,$data); | 36 | $this->response('success',Code::SUCCESS,$data); |
| 36 | } | 37 | } |
| 37 | 38 |
| @@ -67,7 +67,14 @@ class AsideTicketController extends BaseController | @@ -67,7 +67,14 @@ class AsideTicketController extends BaseController | ||
| 67 | }); | 67 | }); |
| 68 | }); | 68 | }); |
| 69 | }); | 69 | }); |
| 70 | - | 70 | + //TODO::用户部门搜索 |
| 71 | + if(isset($this->param['dept_id']) && !empty($this->param['dept_id'])){ | ||
| 72 | + $manageHrModel = new ManageHr(); | ||
| 73 | + $manageIdArr = $manageHrModel->selectField(['dept_id'=>$this->param['dept_id']],'manage_id'); | ||
| 74 | + $query->whereHas('logs', function ($q) use ($manageIdArr) { | ||
| 75 | + $q->whereIn('engineer_id', $manageIdArr); | ||
| 76 | + }); | ||
| 77 | + } | ||
| 71 | // 添加排序功能 | 78 | // 添加排序功能 |
| 72 | $query->orderBy('status', 'asc'); | 79 | $query->orderBy('status', 'asc'); |
| 73 | // $query->orderBy('id', 'desc'); | 80 | // $query->orderBy('id', 'desc'); |
| @@ -178,6 +185,7 @@ class AsideTicketController extends BaseController | @@ -178,6 +185,7 @@ class AsideTicketController extends BaseController | ||
| 178 | $ticket->star = $request->input('star', 3); | 185 | $ticket->star = $request->input('star', 3); |
| 179 | $ticket->plan_end_at = $request->input('plan_end_at', null); | 186 | $ticket->plan_end_at = $request->input('plan_end_at', null); |
| 180 | $ticket->close_wechat = $request->input('close_wechat', false); | 187 | $ticket->close_wechat = $request->input('close_wechat', false); |
| 188 | + $ticket->num = $request->input('num', 0); | ||
| 181 | $ticket->save(); | 189 | $ticket->save(); |
| 182 | 190 | ||
| 183 | // 分配工单参与人 | 191 | // 分配工单参与人 |
| @@ -41,13 +41,20 @@ class WebSettingImageController extends BaseController | @@ -41,13 +41,20 @@ class WebSettingImageController extends BaseController | ||
| 41 | public function save(WebSettingImage $webSettingImage){ | 41 | public function save(WebSettingImage $webSettingImage){ |
| 42 | try { | 42 | try { |
| 43 | foreach ($this->param['data'] as $v){ | 43 | foreach ($this->param['data'] as $v){ |
| 44 | + | ||
| 44 | if(isset($v['id']) && !empty($v['id'])){ | 45 | if(isset($v['id']) && !empty($v['id'])){ |
| 45 | $v['image'] = str_replace_url($v['image']); | 46 | $v['image'] = str_replace_url($v['image']); |
| 46 | $webSettingImage->edit($v,['id'=>$v['id']]); | 47 | $webSettingImage->edit($v,['id'=>$v['id']]); |
| 47 | }else{ | 48 | }else{ |
| 48 | - $v['project_id'] = $this->user['project_id']; | ||
| 49 | - $v['image'] = str_replace_url($v['image']); | ||
| 50 | - $webSettingImage->add($v); | 49 | + $info = $webSettingImage->read(['type'=>$v['type']],'id'); |
| 50 | + if($info === false){ | ||
| 51 | + $v['project_id'] = $this->user['project_id']; | ||
| 52 | + $v['image'] = str_replace_url($v['image']); | ||
| 53 | + $webSettingImage->add($v); | ||
| 54 | + }else{ | ||
| 55 | + $v['image'] = str_replace_url($v['image']); | ||
| 56 | + $webSettingImage->edit($v,['id'=>$info['id']]); | ||
| 57 | + } | ||
| 51 | } | 58 | } |
| 52 | } | 59 | } |
| 53 | }catch (\Exception $e){ | 60 | }catch (\Exception $e){ |
| @@ -10,9 +10,13 @@ | @@ -10,9 +10,13 @@ | ||
| 10 | namespace App\Http\Logic\Aside\Ticket; | 10 | namespace App\Http\Logic\Aside\Ticket; |
| 11 | 11 | ||
| 12 | use App\Http\Logic\Aside\BaseLogic; | 12 | use App\Http\Logic\Aside\BaseLogic; |
| 13 | +use App\Models\Manage\ManageHr; | ||
| 14 | +use App\Models\Project\Project; | ||
| 13 | use App\Models\Ticket\TicketDailyCount; | 15 | use App\Models\Ticket\TicketDailyCount; |
| 14 | use App\Models\Ticket\TicketDailyDeptCount; | 16 | use App\Models\Ticket\TicketDailyDeptCount; |
| 15 | use App\Models\Ticket\TicketDailyManageCount; | 17 | use App\Models\Ticket\TicketDailyManageCount; |
| 18 | +use App\Models\WorkOrder\TicketLog; | ||
| 19 | +use App\Models\WorkOrder\TicketProject; | ||
| 16 | use App\Models\WorkOrder\Tickets; | 20 | use App\Models\WorkOrder\Tickets; |
| 17 | use Illuminate\Support\Carbon; | 21 | use Illuminate\Support\Carbon; |
| 18 | 22 | ||
| @@ -39,6 +43,9 @@ class TicketLogic extends BaseLogic | @@ -39,6 +43,9 @@ class TicketLogic extends BaseLogic | ||
| 39 | $data['add_num'] = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日新增工单 | 43 | $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']]]);//今日已处理工单 | 44 | $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]);//今日未处理工单 | 45 | $data['untreated_num'] = $ticketModel->counts(['end_at'=>null]);//今日未处理工单 |
| 46 | + $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side'); | ||
| 47 | + $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side'); | ||
| 48 | + $data['source'] = ['a'=>$submit_a_side,'b'=>$submit_b_side]; | ||
| 42 | return $this->success($data); | 49 | return $this->success($data); |
| 43 | } | 50 | } |
| 44 | 51 | ||
| @@ -52,16 +59,42 @@ class TicketLogic extends BaseLogic | @@ -52,16 +59,42 @@ class TicketLogic extends BaseLogic | ||
| 52 | public function getDailyTicketCount(){ | 59 | public function getDailyTicketCount(){ |
| 53 | $date = Carbon::yesterday()->toDateString(); //昨日时间 | 60 | $date = Carbon::yesterday()->toDateString(); //昨日时间 |
| 54 | $dailyModel = new TicketDailyCount(); | 61 | $dailyModel = new TicketDailyCount(); |
| 55 | - $dailyList = $dailyModel->list(['date'=>$date],'average_time',['*'],'desc',5);//取最近5条数据 | 62 | + $dailyList = $dailyModel->list([],'date',['*'],'desc',5);//取最近5条数据 |
| 56 | $manageModel = new TicketDailyManageCount(); | 63 | $manageModel = new TicketDailyManageCount(); |
| 57 | - $manageList = $manageModel->list(['date'=>$date],'average_time',['*'],'desc',5);//取最近5条数据 | 64 | + $manageList = $manageModel->list(['date'=>$date,'ticket_num'=>['!=',0],'average_time'=>['!=','']],'average_time',['*'],'asc',5);//取最近5条数据 |
| 58 | $deptModel = new TicketDailyDeptCount(); | 65 | $deptModel = new TicketDailyDeptCount(); |
| 59 | - $deptList = $deptModel->list(['date'=>$date],'average_time',['*'],'desc',5); | 66 | + $deptList = $deptModel->list(['date'=>$date,'ticket_num'=>['!=',0]],'average_time',['*'],'asc',5); |
| 60 | $data = ['daily'=>$dailyList,'manage'=>$manageList,'dept'=>$deptList]; | 67 | $data = ['daily'=>$dailyList,'manage'=>$manageList,'dept'=>$deptList]; |
| 61 | return $this->success($data); | 68 | return $this->success($data); |
| 62 | } | 69 | } |
| 63 | 70 | ||
| 64 | /** | 71 | /** |
| 72 | + * @remark :获取随机工单列表(20条) | ||
| 73 | + * @name :ticketList | ||
| 74 | + * @author :lyh | ||
| 75 | + * @method :post | ||
| 76 | + * @time :2025/8/12 11:06 | ||
| 77 | + */ | ||
| 78 | + public function getTicketList(){ | ||
| 79 | + $ticketsList = Tickets::select(['project_id','title','end_at','end_time','id'])->inRandomOrder()->limit(20)->get(); | ||
| 80 | + $projectModel = new TicketProject(); | ||
| 81 | + $ticketLogModel = new TicketLog(); | ||
| 82 | + $manageModel = new ManageHr(); | ||
| 83 | + foreach ($ticketsList as $key => $item){ | ||
| 84 | + $item['project_name'] = $projectModel->getValue(['id'=>$item['project_id']],'title'); | ||
| 85 | + $engineer_id = $ticketLogModel->getValue(['ticket_id'=>$item['id'],'is_engineer'=>1],'engineer_id'); | ||
| 86 | + if(!empty($engineer_id)){ | ||
| 87 | + $item['manage_name'] = $manageModel->getValue(['manage_id'=>$engineer_id],'name'); | ||
| 88 | + }else{ | ||
| 89 | + $item['manage_name'] = '未分配'; | ||
| 90 | + } | ||
| 91 | + $ticketsList[$key] = $item; | ||
| 92 | + $item['status'] = (empty($item['end_at']) ? '未完成' : '完成'); | ||
| 93 | + } | ||
| 94 | + return $this->success($ticketsList); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + /** | ||
| 65 | * @remark :根据技术组获取 | 98 | * @remark :根据技术组获取 |
| 66 | * @name :getManageTicketCount | 99 | * @name :getManageTicketCount |
| 67 | * @author :lyh | 100 | * @author :lyh |
| @@ -48,7 +48,7 @@ class GeoQuestionResLogic extends BaseLogic | @@ -48,7 +48,7 @@ class GeoQuestionResLogic extends BaseLogic | ||
| 48 | */ | 48 | */ |
| 49 | public function getResultList($map = [],$page = 1,$row = 20){ | 49 | public function getResultList($map = [],$page = 1,$row = 20){ |
| 50 | $map['project_id'] = $this->user['project_id']; | 50 | $map['project_id'] = $this->user['project_id']; |
| 51 | - $filed = ['id','project_id','question_id','platform','question','en_question','keywords','url','created_at','updated_at']; | 51 | + $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','created_at','updated_at']; |
| 52 | if(!empty($map['created_at'])){ | 52 | if(!empty($map['created_at'])){ |
| 53 | $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']]; | 53 | $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']]; |
| 54 | $this->model = new GeoQuestionLog(); | 54 | $this->model = new GeoQuestionLog(); |
| @@ -292,12 +292,14 @@ class UserLoginLogic | @@ -292,12 +292,14 @@ class UserLoginLogic | ||
| 292 | $info['project_location'] = $project['project_location']; | 292 | $info['project_location'] = $project['project_location']; |
| 293 | $info['file_cdn'] = $project['deploy_build']['file_cdn']; | 293 | $info['file_cdn'] = $project['deploy_build']['file_cdn']; |
| 294 | $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; | 294 | $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; |
| 295 | + $info['seo_service_duration'] = $project['deploy_build']['seo_service_duration'] ?? 0; | ||
| 295 | $info['is_comment'] = $project['deploy_build']['is_comment'] ?? 0; | 296 | $info['is_comment'] = $project['deploy_build']['is_comment'] ?? 0; |
| 296 | $info['is_ai_blog_send'] = $project['deploy_optimize']['is_ai_blog_send'] ?? 0; | 297 | $info['is_ai_blog_send'] = $project['deploy_optimize']['is_ai_blog_send'] ?? 0; |
| 297 | $info['tech_leader'] = $project['deploy_optimize']['tech_leader'] ?? 0; | 298 | $info['tech_leader'] = $project['deploy_optimize']['tech_leader'] ?? 0; |
| 298 | $manageModel = new ManageHr(); | 299 | $manageModel = new ManageHr(); |
| 299 | $info['tech_leader_name'] = $manageModel->getName($project['deploy_optimize']['tech_leader'] ?? 0); | 300 | $info['tech_leader_name'] = $manageModel->getName($project['deploy_optimize']['tech_leader'] ?? 0); |
| 300 | $info['remain_day'] = $project['remain_day'] ?? 0; | 301 | $info['remain_day'] = $project['remain_day'] ?? 0; |
| 302 | + $info['seo_remain_day'] = $project['seo_remain_day'] ?? 0; | ||
| 301 | $info['project_created_at'] = $project['created_at']; | 303 | $info['project_created_at'] = $project['created_at']; |
| 302 | $info['type'] = $project['type'] ?? 1; | 304 | $info['type'] = $project['type'] ?? 1; |
| 303 | if($info['is_customized'] == 1){ | 305 | if($info['is_customized'] == 1){ |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Models\Ticket; | 10 | namespace App\Models\Ticket; |
| 11 | 11 | ||
| 12 | +use App\Helper\Arr; | ||
| 12 | use App\Models\Base; | 13 | use App\Models\Base; |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| @@ -21,4 +22,14 @@ use App\Models\Base; | @@ -21,4 +22,14 @@ use App\Models\Base; | ||
| 21 | class TicketDailyCount extends Base | 22 | class TicketDailyCount extends Base |
| 22 | { | 23 | { |
| 23 | protected $table = 'gl_ticket_daily_count'; | 24 | protected $table = 'gl_ticket_daily_count'; |
| 25 | + | ||
| 26 | + public function getSourceAttribute($value) | ||
| 27 | + { | ||
| 28 | + return Arr::s2a($value); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public function getSourceTypeAttribute($value) | ||
| 32 | + { | ||
| 33 | + return Arr::s2a($value); | ||
| 34 | + } | ||
| 24 | } | 35 | } |
-
请 注册 或 登录 后发表评论