Merge remote-tracking branch 'origin/master' into akun
正在显示
13 个修改的文件
包含
326 行增加
和
8 行删除
| @@ -339,7 +339,7 @@ class AiBlogTask extends Command | @@ -339,7 +339,7 @@ class AiBlogTask extends Command | ||
| 339 | ]; | 339 | ]; |
| 340 | $res = http_post($c_url, json_encode($param,true)); | 340 | $res = http_post($c_url, json_encode($param,true)); |
| 341 | if(empty($res)){ | 341 | if(empty($res)){ |
| 342 | - NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url'=>$c_url,'c_params'=>$param]),date('Y-m-d H:i:s',time()+300)); | 342 | + NoticeLog::createLog(NoticeLog::GENERATE_PAGE, ['c_url'=>$c_url,'c_params'=>$param],date('Y-m-d H:i:s',time()+300)); |
| 343 | } | 343 | } |
| 344 | $this->output('notify: project id: ' . $project_id . ', result: ' . json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); | 344 | $this->output('notify: project id: ' . $project_id . ', result: ' . json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); |
| 345 | } | 345 | } |
| @@ -98,9 +98,17 @@ class KeywordPageAiContent extends Command | @@ -98,9 +98,17 @@ class KeywordPageAiContent extends Command | ||
| 98 | public function ai_content(ProjectKeywordAiTask $task) | 98 | public function ai_content(ProjectKeywordAiTask $task) |
| 99 | { | 99 | { |
| 100 | //前后缀 | 100 | //前后缀 |
| 101 | + $default_affix = AggregateKeywordAffix::where('project_id', 0)->first(); | ||
| 101 | $affix = AggregateKeywordAffix::where('project_id', $task->project_id)->first(); | 102 | $affix = AggregateKeywordAffix::where('project_id', $task->project_id)->first(); |
| 102 | - $prefix = empty($affix['prefix']) ? [] : explode("\r\n", $affix['prefix']); | ||
| 103 | - $suffix = empty($affix['suffix']) ? [] : explode("\r\n", $affix['suffix']); | 103 | + |
| 104 | + $default_affix['prefix'] = str_replace("\r\n", "\n", $default_affix['prefix']); | ||
| 105 | + $default_affix['suffix'] = str_replace("\r\n", "\n", $default_affix['suffix']); | ||
| 106 | + $affix['prefix'] = str_replace("\r\n", "\n", $affix['prefix']); | ||
| 107 | + $affix['prefix'] = str_replace("\r\n", "\n", $affix['prefix']); | ||
| 108 | + | ||
| 109 | + $prefix = empty($affix['prefix']) ? explode("\n", $default_affix['prefix']) : explode("\n", $affix['prefix']); | ||
| 110 | + $suffix = empty($affix['suffix']) ? explode("\n", $default_affix['suffix']) : explode("\n", $affix['suffix']); | ||
| 111 | + | ||
| 104 | if (!$prefix || !$suffix) { | 112 | if (!$prefix || !$suffix) { |
| 105 | throw new ValidateException('扩展标题前后缀不存在'); | 113 | throw new ValidateException('扩展标题前后缀不存在'); |
| 106 | } | 114 | } |
| @@ -259,7 +267,7 @@ class KeywordPageAiContent extends Command | @@ -259,7 +267,7 @@ class KeywordPageAiContent extends Command | ||
| 259 | 'url' => [], | 267 | 'url' => [], |
| 260 | 'language' => [], | 268 | 'language' => [], |
| 261 | ]; | 269 | ]; |
| 262 | - NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url' => $url, 'c_params' => $param]), date('Y-m-d H:i:s', time() + 300)); | 270 | + NoticeLog::createLog(NoticeLog::GENERATE_PAGE, ['c_url' => $url, 'c_params' => $param], date('Y-m-d H:i:s', time() + 300)); |
| 263 | echo getmypid() . ' ' . '更新中请稍后, 更新完成将会发送站内信通知更新结果!' . PHP_EOL; | 271 | echo getmypid() . ' ' . '更新中请稍后, 更新完成将会发送站内信通知更新结果!' . PHP_EOL; |
| 264 | } | 272 | } |
| 265 | } | 273 | } |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :UpdateProjectTdk.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/7/2 11:11 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands\Tdk; | ||
| 11 | + | ||
| 12 | +use App\Models\Blog\Blog; | ||
| 13 | +use App\Models\Blog\BlogCategory; | ||
| 14 | +use App\Models\Com\NoticeLog; | ||
| 15 | +use App\Models\CustomModule\CustomModuleCategory; | ||
| 16 | +use App\Models\CustomModule\CustomModuleContent; | ||
| 17 | +use App\Models\News\News; | ||
| 18 | +use App\Models\News\NewsCategory; | ||
| 19 | +use App\Models\Product\Category; | ||
| 20 | +use App\Models\Product\Keyword; | ||
| 21 | +use App\Models\Product\Product; | ||
| 22 | +use App\Models\Project\Project; | ||
| 23 | +use App\Models\RouteMap\RouteMap; | ||
| 24 | +use App\Services\ProjectServer; | ||
| 25 | +use Illuminate\Console\Command; | ||
| 26 | +use Illuminate\Support\Facades\DB; | ||
| 27 | +use Illuminate\Support\Facades\Redis; | ||
| 28 | +use PhpOffice\PhpSpreadsheet\IOFactory; | ||
| 29 | +use function Aws\default_http_handler; | ||
| 30 | + | ||
| 31 | +class UpdateProjectTdk extends Command | ||
| 32 | +{ | ||
| 33 | + /** | ||
| 34 | + * The name and signature of the console command. | ||
| 35 | + * | ||
| 36 | + * @var string | ||
| 37 | + */ | ||
| 38 | + protected $signature = 'update_project_tdk'; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * The console command description. | ||
| 42 | + * | ||
| 43 | + * @var string | ||
| 44 | + */ | ||
| 45 | + protected $description = '根据给定的文件更新项目的tdk'; | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + public function handle(){ | ||
| 49 | + $noticeLogModel = new NoticeLog(); | ||
| 50 | + while (true){ | ||
| 51 | + $task_id = $this->getTaskId(); | ||
| 52 | + if(empty($task_id)){ | ||
| 53 | + sleep(30); | ||
| 54 | + continue; | ||
| 55 | + } | ||
| 56 | + $info = $noticeLogModel->read(['id'=>$task_id]); | ||
| 57 | + if($info !== false){ | ||
| 58 | + echo 'start--'.PHP_EOL; | ||
| 59 | + $project_id = $info['data']['project_id'] ?? 0; | ||
| 60 | + if(empty($project_id)){ | ||
| 61 | + echo date('Y-m-d H:i:s').'未获取到项目id.'.PHP_EOL; | ||
| 62 | + $noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_FAIL],['id'=>$task_id]); | ||
| 63 | + continue; | ||
| 64 | + } | ||
| 65 | + ProjectServer::useProject($project_id); | ||
| 66 | + $url = $info['data']['url'] ?? ''; | ||
| 67 | + if(empty($url)){ | ||
| 68 | + echo date('Y-m-d H:i:s').'未获取到项目更新文件.项目id为:'.$project_id.PHP_EOL; | ||
| 69 | + //未获取到文件,跳过 | ||
| 70 | + $noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_FAIL],['id'=>$task_id]); | ||
| 71 | + DB::disconnect('custom_mysql'); | ||
| 72 | + continue; | ||
| 73 | + } | ||
| 74 | + // 下载到 Laravel storage 的临时路径 | ||
| 75 | + $tempPath = storage_path('app/temp_url.xlsx'); | ||
| 76 | + file_put_contents($tempPath, file_get_contents($url)); | ||
| 77 | + // 载入 Excel | ||
| 78 | + try { | ||
| 79 | + $spreadsheet = IOFactory::load($tempPath); | ||
| 80 | + $sheet = $spreadsheet->getActiveSheet(); | ||
| 81 | + $rows = $sheet->toArray(); | ||
| 82 | + unlink($tempPath); | ||
| 83 | + }catch (\Exception $e){ | ||
| 84 | + echo '文件打不开'.PHP_EOL; | ||
| 85 | + $noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_FAIL],['id'=>$task_id]); | ||
| 86 | + DB::disconnect('custom_mysql'); | ||
| 87 | + continue; | ||
| 88 | + } | ||
| 89 | + $dataRows = array_slice($rows, 1); | ||
| 90 | + foreach ($dataRows as $item){ | ||
| 91 | + //获取路由 | ||
| 92 | + $route = trim($item[0],'/'); | ||
| 93 | + $route = basename($route); | ||
| 94 | + $this->updateTdk($route,$item); | ||
| 95 | + } | ||
| 96 | + echo date('Y-m-d H:i:s').',end'.PHP_EOL; | ||
| 97 | + $noticeLogModel->edit(['status'=>$noticeLogModel::STATUS_SUCCESS],['id'=>$task_id]); | ||
| 98 | + DB::disconnect('custom_mysql'); | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + return true; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * @remark :获取任务id | ||
| 106 | + * @name :getTaskId | ||
| 107 | + * @author :lyh | ||
| 108 | + * @method :post | ||
| 109 | + * @time :2025/7/2 11:19 | ||
| 110 | + */ | ||
| 111 | + public function getTaskId() | ||
| 112 | + { | ||
| 113 | + $task_id = Redis::rpop('update_project_tdk_task'); | ||
| 114 | + if (empty($task_id)) { | ||
| 115 | + $noticeLogModel = new NoticeLog(); | ||
| 116 | + $ids = $noticeLogModel->selectField(['status'=>$noticeLogModel::STATUS_PENDING,'type'=>$noticeLogModel::TYPE_UPDATE_PROJECT_TDK],'id'); | ||
| 117 | + if(!empty($ids)){ | ||
| 118 | + foreach ($ids as $id) { | ||
| 119 | + Redis::lpush('update_project_tdk_task', $id); | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + $task_id = Redis::rpop('update_project_tdk_task'); | ||
| 123 | + } | ||
| 124 | + return $task_id; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + /** | ||
| 128 | + * @remark :更新tdk | ||
| 129 | + * @name :updateTdk | ||
| 130 | + * @author :lyh | ||
| 131 | + * @method :post | ||
| 132 | + * @time :2025/7/2 14:59 | ||
| 133 | + */ | ||
| 134 | + public function updateTdk($route,$item){ | ||
| 135 | + $routeMapModel = new RouteMap(); | ||
| 136 | + $routeInfo = $routeMapModel->read(['route'=>$route]); | ||
| 137 | + if($routeInfo === false){ | ||
| 138 | + return false; | ||
| 139 | + } | ||
| 140 | + switch ($routeInfo['source']){ | ||
| 141 | + case $routeMapModel::SOURCE_PRODUCT: | ||
| 142 | + $productModel = new Product(); | ||
| 143 | + $productModel->edit(['seo_mate'=>json_encode(['title'=>$item[1],'description'=>$item[2],'keyword'=>$item[3]])],['id'=>$routeInfo['source_id']]); | ||
| 144 | + break; | ||
| 145 | + case $routeMapModel::SOURCE_PRODUCT_CATE: | ||
| 146 | + $productCategoryModel = new Category(); | ||
| 147 | + $productCategoryModel->edit(['seo_title'=>$item[1],'seo_des'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 148 | + break; | ||
| 149 | + case $routeMapModel::SOURCE_PRODUCT_KEYWORD: | ||
| 150 | + $productKeywordModel = new Keyword(); | ||
| 151 | + $productKeywordModel->edit(['seo_title'=>$item[1],'seo_description'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 152 | + break; | ||
| 153 | + case $routeMapModel::SOURCE_BLOG: | ||
| 154 | + $blogModel = new Blog(); | ||
| 155 | + $blogModel->edit(['seo_title'=>$item[1],'seo_description'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 156 | + break; | ||
| 157 | + case $routeMapModel::SOURCE_BLOG_CATE: | ||
| 158 | + $blogCateModel = new BlogCategory(); | ||
| 159 | + $blogCateModel->edit(['seo_title'=>$item[1],'seo_des'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 160 | + break; | ||
| 161 | + case $routeMapModel::SOURCE_NEWS: | ||
| 162 | + $newsModel = new News(); | ||
| 163 | + $newsModel->edit(['seo_title'=>$item[1],'seo_description'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 164 | + break; | ||
| 165 | + case $routeMapModel::SOURCE_NEWS_CATE: | ||
| 166 | + $newsCateModel = new NewsCategory(); | ||
| 167 | + $newsCateModel->edit(['seo_title'=>$item[1],'seo_des'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 168 | + break; | ||
| 169 | + case $routeMapModel::SOURCE_MODULE: | ||
| 170 | + $contentModel = new CustomModuleContent(); | ||
| 171 | + $contentModel->edit(['seo_title'=>$item[1],'seo_description'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 172 | + break; | ||
| 173 | + case $routeMapModel::SOURCE_MODULE_CATE: | ||
| 174 | + $categoryModel = new CustomModuleCategory(); | ||
| 175 | + $categoryModel->edit(['seo_title'=>$item[1],'seo_description'=>$item[2],'seo_keywords'=>$item[3]],['id'=>$routeInfo['source_id']]); | ||
| 176 | + break; | ||
| 177 | + default: | ||
| 178 | + break; | ||
| 179 | + } | ||
| 180 | + return true; | ||
| 181 | + } | ||
| 182 | +} |
| @@ -260,7 +260,7 @@ class UpdateSeoTdk extends Command | @@ -260,7 +260,7 @@ class UpdateSeoTdk extends Command | ||
| 260 | 'url' => [], | 260 | 'url' => [], |
| 261 | 'language'=> [], | 261 | 'language'=> [], |
| 262 | ]; | 262 | ]; |
| 263 | - NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url'=>$url,'c_params'=>$param]),date('Y-m-d H:i:s',time()+300)); | 263 | + NoticeLog::createLog(NoticeLog::GENERATE_PAGE, ['c_url'=>$url,'c_params'=>$param],date('Y-m-d H:i:s',time()+300)); |
| 264 | // http_post($url, json_encode($param)); | 264 | // http_post($url, json_encode($param)); |
| 265 | echo getmypid() . ' ' . '更新中请稍后, 更新完成将会发送站内信通知更新结果!'. PHP_EOL; | 265 | echo getmypid() . ' ' . '更新中请稍后, 更新完成将会发送站内信通知更新结果!'. PHP_EOL; |
| 266 | } | 266 | } |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Controllers\Api\WorkOrder; | 3 | namespace App\Http\Controllers\Api\WorkOrder; |
| 4 | 4 | ||
| 5 | use App\Http\Controllers\Api\BaseController; | 5 | use App\Http\Controllers\Api\BaseController; |
| 6 | +use App\Http\Requests\Api\WorkOrder\TicketListRequest; | ||
| 6 | use App\Http\Requests\Api\WorkOrder\TicketStoreRequest; | 7 | use App\Http\Requests\Api\WorkOrder\TicketStoreRequest; |
| 7 | use App\Models\WorkOrder\TicketLog; | 8 | use App\Models\WorkOrder\TicketLog; |
| 8 | use App\Models\WorkOrder\TicketProject; | 9 | use App\Models\WorkOrder\TicketProject; |
| @@ -17,8 +18,9 @@ class TicketController extends BaseController | @@ -17,8 +18,9 @@ class TicketController extends BaseController | ||
| 17 | * | 18 | * |
| 18 | * @return \Illuminate\Http\Response | 19 | * @return \Illuminate\Http\Response |
| 19 | */ | 20 | */ |
| 20 | - public function index($project_id, Request $request) | 21 | + public function index(TicketListRequest $request, $project_id) |
| 21 | { | 22 | { |
| 23 | + $validated = $request->validated(); | ||
| 22 | $project = TicketProject::where('uuid', $project_id)->first(); | 24 | $project = TicketProject::where('uuid', $project_id)->first(); |
| 23 | if (!$project) return $this->error('未找到项目', 404); | 25 | if (!$project) return $this->error('未找到项目', 404); |
| 24 | $page = (int)$request->input('page', 1); | 26 | $page = (int)$request->input('page', 1); |
| @@ -30,6 +32,22 @@ class TicketController extends BaseController | @@ -30,6 +32,22 @@ class TicketController extends BaseController | ||
| 30 | ]) | 32 | ]) |
| 31 | ->where('project_id', $project->id) | 33 | ->where('project_id', $project->id) |
| 32 | // ->where('submit_side', 2) | 34 | // ->where('submit_side', 2) |
| 35 | + ->when($request->input('status') !== null, function ($query) use ($request) { | ||
| 36 | + // status 查 gl_tickets.status | ||
| 37 | + $status = $request->input('status'); | ||
| 38 | + return $query->where('status', $status); | ||
| 39 | + }) | ||
| 40 | + ->when($request->input('search'), function ($query) use ($request) { | ||
| 41 | + // search 查 gl_tickets.title 或 gl_ticket_projects.title 或 gl_ticket_projects.company_name | ||
| 42 | + $search = $request->input('search'); | ||
| 43 | + return $query->where(function ($q) use ($search) { | ||
| 44 | + $q->where('title', 'like', '%' . $search . '%') | ||
| 45 | + ->orWhereHas('project', function ($q1) use ($search) { | ||
| 46 | + $q1->where('title', 'like', '%' . $search . '%') | ||
| 47 | + ->orWhere('company_name', 'like', '%' . $search . '%'); | ||
| 48 | + }); | ||
| 49 | + }); | ||
| 50 | + }) | ||
| 33 | ->orderBy('id', 'desc') | 51 | ->orderBy('id', 'desc') |
| 34 | ->paginate($size, ['*'], 'page', $page); | 52 | ->paginate($size, ['*'], 'page', $page); |
| 35 | return response()->json(['data' => $tickets]); | 53 | return response()->json(['data' => $tickets]); |
| @@ -1259,4 +1259,23 @@ class ProjectController extends BaseController | @@ -1259,4 +1259,23 @@ class ProjectController extends BaseController | ||
| 1259 | NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->param['project_id']]); | 1259 | NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->param['project_id']]); |
| 1260 | $this->response('success'); | 1260 | $this->response('success'); |
| 1261 | } | 1261 | } |
| 1262 | + | ||
| 1263 | + /** | ||
| 1264 | + * @remark :更新项目tdk | ||
| 1265 | + * @name :updateTdk | ||
| 1266 | + * @author :lyh | ||
| 1267 | + * @method :post | ||
| 1268 | + * @time :2025/7/2 11:04 | ||
| 1269 | + */ | ||
| 1270 | + public function updateTdk(){ | ||
| 1271 | + $this->request->validate([ | ||
| 1272 | + 'project_id'=>'required', | ||
| 1273 | + 'url'=>'required' | ||
| 1274 | + ],[ | ||
| 1275 | + 'project_id.required' => '项目id不能为空', | ||
| 1276 | + 'url.required' => '文件路径不为空', | ||
| 1277 | + ]); | ||
| 1278 | + NoticeLog::createLog(NoticeLog::TYPE_UPDATE_PROJECT_TDK, ['project_id' => $this->param['project_id'],'url'=>$this->param['url']]); | ||
| 1279 | + $this->response('success',Code::SUCCESS,['url'=>$this->param['url']]); | ||
| 1280 | + } | ||
| 1262 | } | 1281 | } |
| @@ -8,6 +8,8 @@ use App\Http\Requests\Aside\WorkOrder\AsideTicketStoreRequest; | @@ -8,6 +8,8 @@ use App\Http\Requests\Aside\WorkOrder\AsideTicketStoreRequest; | ||
| 8 | use App\Http\Requests\Aside\WorkOrder\AsideTicketListRequest; | 8 | use App\Http\Requests\Aside\WorkOrder\AsideTicketListRequest; |
| 9 | use App\Http\Requests\Aside\WorkOrder\AsideTicketUpdateRequest; | 9 | use App\Http\Requests\Aside\WorkOrder\AsideTicketUpdateRequest; |
| 10 | use App\Http\Requests\Aside\WorkOrder\TicketProjectListRequest; | 10 | use App\Http\Requests\Aside\WorkOrder\TicketProjectListRequest; |
| 11 | +use App\Models\ProjectAssociation\ProjectAssociation; | ||
| 12 | +use App\Models\Workchat\MessagePush; | ||
| 11 | use App\Models\WorkOrder\TicketLog; | 13 | use App\Models\WorkOrder\TicketLog; |
| 12 | use App\Models\WorkOrder\TicketProject; | 14 | use App\Models\WorkOrder\TicketProject; |
| 13 | use App\Models\WorkOrder\Tickets; | 15 | use App\Models\WorkOrder\Tickets; |
| @@ -216,4 +218,45 @@ class AsideTicketController extends BaseController | @@ -216,4 +218,45 @@ class AsideTicketController extends BaseController | ||
| 216 | { | 218 | { |
| 217 | // | 219 | // |
| 218 | } | 220 | } |
| 221 | + | ||
| 222 | + | ||
| 223 | + /** | ||
| 224 | + * 手动触发,推送工单到企微群 | ||
| 225 | + */ | ||
| 226 | + public function pushNotify($id) | ||
| 227 | + { | ||
| 228 | + $project = TicketProject::where('uuid', $id) | ||
| 229 | + ->where('is_del', 0) | ||
| 230 | + ->first(); | ||
| 231 | + | ||
| 232 | + if (empty($project)) | ||
| 233 | + $this->response('工单项目不存在', Code::USER_MODEL_NOTFOUND_ERROE); | ||
| 234 | + | ||
| 235 | + if (empty($project->association)) { | ||
| 236 | + $this->response('该工单没有绑定的企微群', Code::USER_MODEL_NOTFOUND_ERROE); | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + $ticket = Tickets::where('project_id', $project->id) | ||
| 240 | + ->orderBy('id', 'desc') | ||
| 241 | + ->first(); | ||
| 242 | + | ||
| 243 | + $message_push = new MessagePush(); | ||
| 244 | + $message_push->project_id = $project->table_id; | ||
| 245 | + $message_push->friend_id = $project->association->friend_id; | ||
| 246 | + $message_push->content_type = 'Link'; | ||
| 247 | + $message_push->content = json_encode([ | ||
| 248 | + 'title' => '工单查看 - ' . $project->company_name, | ||
| 249 | + 'desc' => $ticket ? $ticket->title : "工单列表", | ||
| 250 | + 'size' => 0, | ||
| 251 | + 'thumbSize' => 0, | ||
| 252 | + 'thumbUrl' => 'https://oa.quanqiusou.cn/logo.ico', | ||
| 253 | + 'url' => 'https://oa.quanqiusou.cn/afterorder?project_id='.$project->uuid | ||
| 254 | + ], JSON_UNESCAPED_UNICODE); | ||
| 255 | + $message_push->send_time = now(); | ||
| 256 | + $message_push->type = MessagePush::TYPE_TICKET; | ||
| 257 | + $message_push->save(); | ||
| 258 | + $ticket->ding = 1; // 标记为已推送 | ||
| 259 | + $ticket->save(); | ||
| 260 | + $this->response('success', Code::SUCCESS); | ||
| 261 | + } | ||
| 219 | } | 262 | } |
| @@ -304,7 +304,7 @@ class CNoticeController extends BaseController | @@ -304,7 +304,7 @@ class CNoticeController extends BaseController | ||
| 304 | try { | 304 | try { |
| 305 | http_post($c_url, json_encode($c_param)); | 305 | http_post($c_url, json_encode($c_param)); |
| 306 | }catch (\Exception $e){ | 306 | }catch (\Exception $e){ |
| 307 | - NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url'=>$c_url,'c_params'=>$c_param])); | 307 | + NoticeLog::createLog(NoticeLog::GENERATE_PAGE, ['c_url'=>$c_url,'c_params'=>$c_param]); |
| 308 | } | 308 | } |
| 309 | } | 309 | } |
| 310 | $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!'); | 310 | $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!'); |
| @@ -17,7 +17,7 @@ use App\Models\RankData\RankDataBmseo; | @@ -17,7 +17,7 @@ use App\Models\RankData\RankDataBmseo; | ||
| 17 | use App\Models\SeoSetting\LinkData; | 17 | use App\Models\SeoSetting\LinkData; |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | - * @remark :报表详情数据 | 20 | + * @remark :白帽seo报表详情数据(权威评分) |
| 21 | * @name :AuthorityScoreLogic | 21 | * @name :AuthorityScoreLogic |
| 22 | * @author :lyh | 22 | * @author :lyh |
| 23 | * @method :post | 23 | * @method :post |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Requests\Api\WorkOrder; | ||
| 4 | + | ||
| 5 | +use Illuminate\Foundation\Http\FormRequest; | ||
| 6 | + | ||
| 7 | +class TicketListRequest extends FormRequest | ||
| 8 | +{ | ||
| 9 | + /** | ||
| 10 | + * Determine if the user is authorized to make this request. | ||
| 11 | + * | ||
| 12 | + * @return bool | ||
| 13 | + */ | ||
| 14 | + public function authorize() | ||
| 15 | + { | ||
| 16 | + return true; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * Get the validation rules that apply to the request. | ||
| 21 | + * | ||
| 22 | + * @return array | ||
| 23 | + */ | ||
| 24 | + public function rules() | ||
| 25 | + { | ||
| 26 | + return [ | ||
| 27 | + 'status' => 'nullable|in:0,1,2,3|integer', | ||
| 28 | + 'search' => 'nullable|string', // 搜索关键词 | ||
| 29 | + 'page' => 'nullable|integer', | ||
| 30 | + 'size' => 'nullable|integer', | ||
| 31 | + ]; | ||
| 32 | + } | ||
| 33 | +} |
| @@ -15,6 +15,7 @@ class NoticeLog extends Base | @@ -15,6 +15,7 @@ class NoticeLog extends Base | ||
| 15 | const TYPE_INIT_PROJECT = 'init_project'; | 15 | const TYPE_INIT_PROJECT = 'init_project'; |
| 16 | const TYPE_INIT_KEYWORD_COMMENT = 'init_keyword_comment';//聚合页关键词评论 | 16 | const TYPE_INIT_KEYWORD_COMMENT = 'init_keyword_comment';//聚合页关键词评论 |
| 17 | const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成 | 17 | const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成 |
| 18 | + const TYPE_UPDATE_PROJECT_TDK = 'updated_project_tdk';//根据路由更新tdk | ||
| 18 | const TYPE_COPY_PROJECT = 'copy_project'; | 19 | const TYPE_COPY_PROJECT = 'copy_project'; |
| 19 | const TYPE_INIT_KEYWORD = 'init_keyword'; | 20 | const TYPE_INIT_KEYWORD = 'init_keyword'; |
| 20 | const DELETE_PRODUCT_CATEGORY = 'delete_product_category'; | 21 | const DELETE_PRODUCT_CATEGORY = 'delete_product_category'; |
| @@ -5,6 +5,7 @@ namespace App\Models\WorkOrder; | @@ -5,6 +5,7 @@ namespace App\Models\WorkOrder; | ||
| 5 | use App\Models\Base; | 5 | use App\Models\Base; |
| 6 | use App\Models\Manage\Manage; | 6 | use App\Models\Manage\Manage; |
| 7 | use App\Models\Project\Project; | 7 | use App\Models\Project\Project; |
| 8 | +use App\Models\ProjectAssociation\ProjectAssociation; | ||
| 8 | use Illuminate\Database\Eloquent\Factories\HasFactory; | 9 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 9 | 10 | ||
| 10 | class TicketProject extends Base | 11 | class TicketProject extends Base |
| @@ -41,4 +42,15 @@ class TicketProject extends Base | @@ -41,4 +42,15 @@ class TicketProject extends Base | ||
| 41 | return $this->hasOne(Manage::class, 'id', 'engineer_id') | 42 | return $this->hasOne(Manage::class, 'id', 'engineer_id') |
| 42 | ->select(['id', 'name']); | 43 | ->select(['id', 'name']); |
| 43 | } | 44 | } |
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 绑定的企微群 | ||
| 48 | + */ | ||
| 49 | + public function association() | ||
| 50 | + { | ||
| 51 | + return $this->hasOne(ProjectAssociation::class, 'project_id', 'table_id') | ||
| 52 | + ->where('status', 1) | ||
| 53 | + ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT) | ||
| 54 | + ->select(['id', 'project_id', 'friend_id', 'binding_app']); | ||
| 55 | + } | ||
| 44 | } | 56 | } |
| @@ -204,6 +204,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -204,6 +204,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 204 | Route::any('/updateProjectManager', [Aside\Project\ProjectController::class, 'updateProjectManager'])->name('admin.project_updateProjectManager');//更改项目人员配置 | 204 | Route::any('/updateProjectManager', [Aside\Project\ProjectController::class, 'updateProjectManager'])->name('admin.project_updateProjectManager');//更改项目人员配置 |
| 205 | Route::any('/setIsParticiple', [Aside\Project\ProjectController::class, 'setIsParticiple'])->name('admin.project_setIsParticiple');//开启/关闭分词 | 205 | Route::any('/setIsParticiple', [Aside\Project\ProjectController::class, 'setIsParticiple'])->name('admin.project_setIsParticiple');//开启/关闭分词 |
| 206 | Route::any('/saveSiteStatus', [Aside\Project\ProjectController::class, 'saveSiteStatus'])->name('admin.project_saveSiteStatus'); | 206 | Route::any('/saveSiteStatus', [Aside\Project\ProjectController::class, 'saveSiteStatus'])->name('admin.project_saveSiteStatus'); |
| 207 | + Route::any('/updateTdk', [Aside\Project\ProjectController::class, 'updateTdk'])->name('admin.project_updateTdk');//更新项目tdk | ||
| 207 | //获取关键词前缀和后缀 | 208 | //获取关键词前缀和后缀 |
| 208 | Route::prefix('keyword')->group(function () { | 209 | Route::prefix('keyword')->group(function () { |
| 209 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); | 210 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); |
| @@ -254,6 +255,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -254,6 +255,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 254 | Route::post('/', [Aside\WorkOrder\AsideTicketController::class, 'store'])->name('admin.tickets.store')->summary('A端创建工单'); | 255 | Route::post('/', [Aside\WorkOrder\AsideTicketController::class, 'store'])->name('admin.tickets.store')->summary('A端创建工单'); |
| 255 | Route::get('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'show'])->name('admin.tickets.show')->summary('A端工单详情'); | 256 | Route::get('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'show'])->name('admin.tickets.show')->summary('A端工单详情'); |
| 256 | Route::post('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'update'])->name('admin.tickets.update')->summary('A端更新工单,审核,邀请同事'); | 257 | Route::post('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'update'])->name('admin.tickets.update')->summary('A端更新工单,审核,邀请同事'); |
| 258 | + Route::get('/pushNotify/{id}', [Aside\WorkOrder\AsideTicketController::class, 'pushNotify'])->name('admin.tickets.pushNotify')->summary('A端工单推送企微群'); | ||
| 257 | Route::get('/projects/{search}', [Aside\WorkOrder\AsideTicketController::class, 'getProjects'])->name('admin.tickets.projects')->summary('A端V5V6项目列表'); | 259 | Route::get('/projects/{search}', [Aside\WorkOrder\AsideTicketController::class, 'getProjects'])->name('admin.tickets.projects')->summary('A端V5V6项目列表'); |
| 258 | Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表'); | 260 | Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表'); |
| 259 | Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); | 261 | Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); |
-
请 注册 或 登录 后发表评论