合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !2845
正在显示
9 个修改的文件
包含
615 行增加
和
4 行删除
| @@ -43,7 +43,7 @@ class RemainDay extends Command | @@ -43,7 +43,7 @@ class RemainDay extends Command | ||
| 43 | * @var 暂停的项目 | 43 | * @var 暂停的项目 |
| 44 | */ | 44 | */ |
| 45 | protected $ceaseProjectId = [ | 45 | protected $ceaseProjectId = [ |
| 46 | - 354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685, 3931 | 46 | + 354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685, 3931,2273,3647 |
| 47 | ];//需要单独处理的项目 | 47 | ];//需要单独处理的项目 |
| 48 | /** | 48 | /** |
| 49 | * The console command description. | 49 | * The console command description. |
| @@ -20,14 +20,83 @@ use Illuminate\Support\Facades\Cache; | @@ -20,14 +20,83 @@ use Illuminate\Support\Facades\Cache; | ||
| 20 | */ | 20 | */ |
| 21 | class BaseController extends Controller | 21 | class BaseController extends Controller |
| 22 | { | 22 | { |
| 23 | - public $param; | ||
| 24 | - public $request; | 23 | + protected $param = [];//所有请求参数 |
| 24 | + protected $token = ''; //token | ||
| 25 | + protected $request = [];//助手函数 | ||
| 26 | + protected $page = 1;//当前页 | ||
| 27 | + protected $row = 20;//每页条数 | ||
| 28 | + protected $header = [];//设置请求头参数 | ||
| 29 | + protected $order = 'created_at'; | ||
| 30 | + protected $order_type = 'desc'; | ||
| 31 | + protected $map = [];//处理后的参数 | ||
| 32 | + | ||
| 25 | 33 | ||
| 26 | public function __construct(Request $request) | 34 | public function __construct(Request $request) |
| 27 | { | 35 | { |
| 28 | $this->request = $request; | 36 | $this->request = $request; |
| 29 | $this->param = $this->request->all(); | 37 | $this->param = $this->request->all(); |
| 38 | + $this->getParam(); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * @remark :请求参数处理 | ||
| 43 | + * @name :getParam | ||
| 44 | + * @author :lyh | ||
| 45 | + * @method :post | ||
| 46 | + * @time :2023/6/17 16:34 | ||
| 47 | + */ | ||
| 48 | + public function getParam(){ | ||
| 49 | + foreach ($this->param as $k => $v){ | ||
| 50 | + if(is_array($v)){ | ||
| 51 | + $this->map[$k] = $v; | ||
| 52 | + }else{ | ||
| 53 | + $this->getMap($k,$v); | ||
| 54 | + } | ||
| 55 | + } | ||
| 30 | } | 56 | } |
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * @remark :搜索参数处理 | ||
| 60 | + * @name :getMap | ||
| 61 | + * @author :lyh | ||
| 62 | + * @method :post | ||
| 63 | + * @time :2023/8/28 10:22 | ||
| 64 | + */ | ||
| 65 | + public function getMap($k,$v){ | ||
| 66 | + switch ($k){ | ||
| 67 | + case "order": | ||
| 68 | + $this->order = $v; | ||
| 69 | + break; | ||
| 70 | + case "order_type": | ||
| 71 | + $this->order_type = $v; | ||
| 72 | + break; | ||
| 73 | + case 'page': | ||
| 74 | + $this->page = $v; | ||
| 75 | + break; | ||
| 76 | + case 'row': | ||
| 77 | + case 'size': | ||
| 78 | + $this->row = $v; | ||
| 79 | + break; | ||
| 80 | + case "name": | ||
| 81 | + $this->map['name'] = ['like','%'.$v.'%']; | ||
| 82 | + break; | ||
| 83 | + case "start_at": | ||
| 84 | + $this->_btw[0] = $v; | ||
| 85 | + $this->_btw[1] = date('Y-m-d H:i:s',time()); | ||
| 86 | + $this->map['created_at'] = ['between', $this->_btw]; | ||
| 87 | + break; | ||
| 88 | + case "end_at": | ||
| 89 | + $this->_btw[1] = $v; | ||
| 90 | + $this->map['created_at'] = ['between', $this->_btw]; | ||
| 91 | + break; | ||
| 92 | + default: | ||
| 93 | + if (!empty($v) || $v == 0) { | ||
| 94 | + $this->map[$k] = $v; | ||
| 95 | + } | ||
| 96 | + break; | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | + | ||
| 31 | /** | 100 | /** |
| 32 | * @param array $data | 101 | * @param array $data |
| 33 | * @param string $message | 102 | * @param string $message |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TicketUploadDataController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/9/25 09:40 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Api\WorkOrder; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Api\BaseController; | ||
| 14 | +use App\Models\Blog\BlogCategory; | ||
| 15 | +use App\Models\News\NewsCategory; | ||
| 16 | +use App\Models\Product\Category; | ||
| 17 | +use App\Models\Product\Keyword; | ||
| 18 | +use App\Models\Ticket\TicketUploadData; | ||
| 19 | +use App\Services\ProjectServer; | ||
| 20 | +use Illuminate\Http\Request; | ||
| 21 | +use Illuminate\Support\Facades\DB; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * @remark :上传产品/博客/新闻模块 | ||
| 25 | + * @name :TicketUploadDataController | ||
| 26 | + * @author :lyh | ||
| 27 | + * @method :post | ||
| 28 | + * @time :2025/9/25 09:40 | ||
| 29 | + */ | ||
| 30 | +class TicketUploadDataController extends BaseController | ||
| 31 | +{ | ||
| 32 | + public function __construct(Request $request) | ||
| 33 | + { | ||
| 34 | + parent::__construct($request); | ||
| 35 | + $this->model = new TicketUploadData(); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * @remark :已提交列表 | ||
| 40 | + * @name :lists | ||
| 41 | + * @author :lyh | ||
| 42 | + * @method :post | ||
| 43 | + * @time :2025/9/25 10:28 | ||
| 44 | + */ | ||
| 45 | + public function lists() | ||
| 46 | + { | ||
| 47 | + $this->request->validate([ | ||
| 48 | + 'project_id' => 'required', | ||
| 49 | + ], [ | ||
| 50 | + 'project_id.required' => 'project_id不能为空', | ||
| 51 | + ]); | ||
| 52 | + $data = $this->model->lists($this->map, $this->page, $this->row, $this->order); | ||
| 53 | + $this->response('success', Code::SUCCESS, $data); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * @remark :获取数据详情 | ||
| 58 | + * @name :info | ||
| 59 | + * @author :lyh | ||
| 60 | + * @method :post | ||
| 61 | + * @time :2025/9/25 10:35 | ||
| 62 | + */ | ||
| 63 | + public function info() | ||
| 64 | + { | ||
| 65 | + $this->request->validate([ | ||
| 66 | + 'id' => 'required', | ||
| 67 | + ], [ | ||
| 68 | + 'id.required' => 'id不能为空', | ||
| 69 | + ]); | ||
| 70 | + $data = $this->model->read($this->param); | ||
| 71 | + $this->response('success', Code::SUCCESS, $data); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * @remark :提交数据 | ||
| 76 | + * @name :save | ||
| 77 | + * @author :lyh | ||
| 78 | + * @method :post | ||
| 79 | + * @time :2025/9/25 09:48 | ||
| 80 | + */ | ||
| 81 | + public function save() | ||
| 82 | + { | ||
| 83 | + $this->request->validate([ | ||
| 84 | + 'project_id' => 'required', | ||
| 85 | + 'type' => 'required', | ||
| 86 | + 'text' => 'required' | ||
| 87 | + ], [ | ||
| 88 | + 'project_id.required' => 'project_id不能为空', | ||
| 89 | + 'type.required' => '上传类型不能为空', | ||
| 90 | + 'text' => '数据详情不为空' | ||
| 91 | + ]); | ||
| 92 | + //验证当前数据是否已提交 | ||
| 93 | + $this->param['text'] = json_encode($this->param['text'], true); | ||
| 94 | + $info = $this->model->read(['project_id' => $this->$this->param['project_id'], 'type' => $this->param['type'], 'text' => $this->param['text'], 'status' => 0]); | ||
| 95 | + if ($info === false) { | ||
| 96 | + $id = $this->model->addReturnId($this->param); | ||
| 97 | + } else { | ||
| 98 | + $id = $info['id']; | ||
| 99 | + } | ||
| 100 | + $data = ['id' => $id]; | ||
| 101 | + $this->response('success', Code::SUCCESS, $data); | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * @remark :根据项目获取分类 | ||
| 106 | + * @name :getProductCate | ||
| 107 | + * @author :lyh | ||
| 108 | + * @method :post | ||
| 109 | + * @time :2025/9/25 15:41 | ||
| 110 | + */ | ||
| 111 | + public function getProductCate() | ||
| 112 | + { | ||
| 113 | + $this->request->validate([ | ||
| 114 | + 'project_id' => 'required', | ||
| 115 | + 'type' => 'required', | ||
| 116 | + 'search' => 'required' | ||
| 117 | + ], [ | ||
| 118 | + 'project_id.required' => 'project_id不能为空', | ||
| 119 | + 'type.required' => 'type不能为空', | ||
| 120 | + 'search.required' => '搜索参数不能为空', | ||
| 121 | + ]); | ||
| 122 | + ProjectServer::useProject($this->param['project_id']); | ||
| 123 | + if ($this->param['type'] == 1) { | ||
| 124 | + //todo::搜索获取分类 | ||
| 125 | + $productCateModel = new Category(); | ||
| 126 | + $data = $productCateModel->lists(['title' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); | ||
| 127 | + } else { | ||
| 128 | + $keywordModel = new Keyword(); | ||
| 129 | + $data = $keywordModel->lists(['title' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); | ||
| 130 | + } | ||
| 131 | + DB::disconnect('custom_mysql'); | ||
| 132 | + $this->response('success', Code::SUCCESS, $data); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + /** | ||
| 136 | + * @remark :获取博客分类 | ||
| 137 | + * @name :getBlogCate | ||
| 138 | + * @author :lyh | ||
| 139 | + * @method :post | ||
| 140 | + * @time :2025/9/25 15:42 | ||
| 141 | + */ | ||
| 142 | + public function getBlogCate() | ||
| 143 | + { | ||
| 144 | + $this->request->validate([ | ||
| 145 | + 'project_id' => 'required', | ||
| 146 | + 'search' => 'required' | ||
| 147 | + ], [ | ||
| 148 | + 'project_id.required' => 'project_id不能为空', | ||
| 149 | + 'search.required' => '搜索参数不能为空', | ||
| 150 | + ]); | ||
| 151 | + ProjectServer::useProject($this->param['project_id']); | ||
| 152 | + $blogCateModel = new BlogCategory(); | ||
| 153 | + $data = $blogCateModel->lists(['name' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); | ||
| 154 | + DB::disconnect('custom_mysql'); | ||
| 155 | + $this->response('success', Code::SUCCESS, $data); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + /** | ||
| 159 | + * @remark :获取新闻分类 | ||
| 160 | + * @name :getNewsCate | ||
| 161 | + * @author :lyh | ||
| 162 | + * @method :post | ||
| 163 | + * @time :2025/9/25 15:43 | ||
| 164 | + */ | ||
| 165 | + public function getNewsCate() | ||
| 166 | + { | ||
| 167 | + $this->request->validate([ | ||
| 168 | + 'project_id' => 'required', | ||
| 169 | + 'search' => 'required' | ||
| 170 | + ], [ | ||
| 171 | + 'project_id.required' => 'project_id不能为空', | ||
| 172 | + 'search.required' => '搜索参数不能为空', | ||
| 173 | + ]); | ||
| 174 | + ProjectServer::useProject($this->param['project_id']); | ||
| 175 | + $newsCateModel = new NewsCategory(); | ||
| 176 | + $data = $newsCateModel->lists(['name' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); | ||
| 177 | + DB::disconnect('custom_mysql'); | ||
| 178 | + $this->response('success', Code::SUCCESS, $data); | ||
| 179 | + } | ||
| 180 | +} |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TicketUploadDataController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/9/25 14:00 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Aside\BaseController; | ||
| 14 | +use App\Http\Logic\Aside\Ticket\TicketUploadDataLogic; | ||
| 15 | +use Illuminate\Http\Request; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @remark :工单上传列表审核功能 | ||
| 19 | + * @name :TicketUploadDataController | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2025/9/25 14:01 | ||
| 23 | + */ | ||
| 24 | +class TicketUploadDataController extends BaseController | ||
| 25 | +{ | ||
| 26 | + public function __construct(Request $request) | ||
| 27 | + { | ||
| 28 | + parent::__construct($request); | ||
| 29 | + $this->logic = new TicketUploadDataLogic(); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * @remark :获取审核列表 | ||
| 34 | + * @name :lists | ||
| 35 | + * @author :lyh | ||
| 36 | + * @method :post | ||
| 37 | + * @time :2025/9/25 14:02 | ||
| 38 | + */ | ||
| 39 | + public function lists(){ | ||
| 40 | + if(isset($this->map['text']) && !empty($this->map['text'])){ | ||
| 41 | + $this->map['text'] = ['like','%'.$this->map['text'].'%']; | ||
| 42 | + } | ||
| 43 | + $data = $this->logic->getDataList($this->map,$this->page,$this->row,$this->order); | ||
| 44 | + $this->response('success',Code::SUCCESS,$data); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * @remark :获取数据详情 | ||
| 49 | + * @name :detail | ||
| 50 | + * @author :lyh | ||
| 51 | + * @method :post | ||
| 52 | + * @time :2025/9/26 09:29 | ||
| 53 | + */ | ||
| 54 | + public function detail(){ | ||
| 55 | + $this->request->validate([ | ||
| 56 | + 'id'=>'required' | ||
| 57 | + ],[ | ||
| 58 | + 'id.required' => '主键ID不能为空', | ||
| 59 | + ]); | ||
| 60 | + $data = $this->logic->getDetail(); | ||
| 61 | + $this->response('success',Code::SUCCESS,$data); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * @remark :人工审核 | ||
| 66 | + * @name :save | ||
| 67 | + * @author :lyh | ||
| 68 | + * @method :post | ||
| 69 | + * @time :2025/9/25 14:14 | ||
| 70 | + */ | ||
| 71 | + public function save() | ||
| 72 | + { | ||
| 73 | + $this->request->validate([ | ||
| 74 | + 'status'=>'required', | ||
| 75 | + 'id'=>'required' | ||
| 76 | + ],[ | ||
| 77 | + 'status.required' => '提交状态不能为空', | ||
| 78 | + 'id.required' => '主键ID不能为空', | ||
| 79 | + ]); | ||
| 80 | + $data = $this->logic->saveData(); | ||
| 81 | + $this->response('success',Code::SUCCESS,$data); | ||
| 82 | + } | ||
| 83 | +} |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TicketUploadDataLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/9/25 14:03 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Aside\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Helper\Arr; | ||
| 13 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 14 | +use App\Models\Blog\Blog; | ||
| 15 | +use App\Models\News\News; | ||
| 16 | +use App\Models\Product\CategoryRelated; | ||
| 17 | +use App\Models\Product\KeywordRelated; | ||
| 18 | +use App\Models\Product\Product; | ||
| 19 | +use App\Models\RouteMap\RouteMap; | ||
| 20 | +use App\Models\Ticket\TicketUploadData; | ||
| 21 | +use App\Services\ProjectServer; | ||
| 22 | +use Illuminate\Support\Facades\DB; | ||
| 23 | + | ||
| 24 | +class TicketUploadDataLogic extends BaseLogic | ||
| 25 | +{ | ||
| 26 | + public function __construct() | ||
| 27 | + { | ||
| 28 | + parent::__construct(); | ||
| 29 | + $this->param = $this->requestAll; | ||
| 30 | + $this->model = new TicketUploadData(); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * @remark :获取审核列表 | ||
| 35 | + * @name :getDataList | ||
| 36 | + * @author :lyh | ||
| 37 | + * @method :post | ||
| 38 | + * @time :2025/9/25 14:17 | ||
| 39 | + */ | ||
| 40 | + public function getDataList($map = [],$page = 1,$row = 20,$order = 'id'){ | ||
| 41 | + if(isset($this->map['text']) && !empty($this->map['text'])){ | ||
| 42 | + $this->map['text'] = ['like','%'.$this->map['text'].'%']; | ||
| 43 | + } | ||
| 44 | + $data = $this->model->lists($map,$page,$row,$order); | ||
| 45 | + foreach ($data as &$v){ | ||
| 46 | + $v = $this->getHandleFileImage($v); | ||
| 47 | + } | ||
| 48 | + return $this->success($data); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * @remark :处理数据 | ||
| 53 | + * @name :getHandleFileImage | ||
| 54 | + * @author :lyh | ||
| 55 | + * @method :post | ||
| 56 | + * @time :2025/9/25 16:53 | ||
| 57 | + */ | ||
| 58 | + public function getHandleFileImage($v){ | ||
| 59 | + if($v['type'] == 1){ | ||
| 60 | + if(!empty($v['text']['image'])){ | ||
| 61 | + foreach ($v['text']['image'] as $gallery_k => $gallery_v){ | ||
| 62 | + $gallery_v['url'] = getImageUrl($gallery_v['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | ||
| 63 | + $info['text']['image'][$gallery_k] = $gallery_v; | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + }else{ | ||
| 67 | + $v['text']['image'] = getImageUrl($v['text']['image'],$this->user['storage_type'],$this->user['project_location']); | ||
| 68 | + } | ||
| 69 | + return $this->success($v); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * @remark :获取当前数据详情 | ||
| 74 | + * @name :getDetail | ||
| 75 | + * @author :lyh | ||
| 76 | + * @method :post | ||
| 77 | + * @time :2025/9/26 09:31 | ||
| 78 | + */ | ||
| 79 | + public function getDetail(){ | ||
| 80 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 81 | + if($info === false){ | ||
| 82 | + $this->fail('当前数据不存在或已被删除'); | ||
| 83 | + } | ||
| 84 | + $info = $this->getHandleFileImage($info); | ||
| 85 | + return $this->success($info); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * @remark :保存数据 | ||
| 90 | + * @name :saveData | ||
| 91 | + * @author :lyh | ||
| 92 | + * @method :post | ||
| 93 | + * @time :2025/9/25 17:01 | ||
| 94 | + */ | ||
| 95 | + public function saveData() | ||
| 96 | + { | ||
| 97 | + //获取当前数据详情 | ||
| 98 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 99 | + if($info === false){ | ||
| 100 | + $this->fail('当前数据不存在或已被删除'); | ||
| 101 | + } | ||
| 102 | + //审核成功执行 | ||
| 103 | + if($this->param['status'] == 1){ | ||
| 104 | + ProjectServer::useProject($info['project_id']); | ||
| 105 | + if($info['type'] == 1){ | ||
| 106 | + $this->saveProductData($info); | ||
| 107 | + }elseif ($info['type'] == 2){ | ||
| 108 | + $this->saveBlogData($info); | ||
| 109 | + }else{ | ||
| 110 | + $this->saveNewsData($info); | ||
| 111 | + } | ||
| 112 | + DB::disconnect('custom_mysql'); | ||
| 113 | + } | ||
| 114 | + $data = $this->model->edit(['status'=>$this->param['status'],'operator_id'=>$this->manager['id'],'remark'=>$this->param['remark'] ?? ''],['id'=>$this->param['id']]); | ||
| 115 | + return $this->success($data); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + /** | ||
| 119 | + * @remark :保存数据详情 | ||
| 120 | + * @name :saveData | ||
| 121 | + * @author :lyh | ||
| 122 | + * @method :post | ||
| 123 | + * @time :2025/9/25 14:17 | ||
| 124 | + */ | ||
| 125 | + public function saveProductData($info){ | ||
| 126 | + if(isset($info['text']['keyword_id']) && !empty($info['text']['keyword_id'])){ | ||
| 127 | + $keyword_id = ','.Arr::arrToSet($info['text']['keyword_id']).','; | ||
| 128 | + } | ||
| 129 | + if(isset($info['text']['category_id']) && !empty($info['text']['category_id'])) { | ||
| 130 | + $category_id = ','.Arr::arrToSet($info['text']['category_id']).','; | ||
| 131 | + } | ||
| 132 | + if(isset($info['text']['image']) && !empty($info['text']['image'])){ | ||
| 133 | + foreach ($info['text']['image'] as $k => $v){ | ||
| 134 | + $v['url'] = str_replace_url($v['url']); | ||
| 135 | + $info['text']['image'][$k] = $v; | ||
| 136 | + } | ||
| 137 | + $info['text']['image'] = Arr::a2s($info['text']['image'] ?? []); | ||
| 138 | + }else{ | ||
| 139 | + $info['text']['image'] = Arr::a2s([]); | ||
| 140 | + } | ||
| 141 | + try { | ||
| 142 | + $productModel = new Product(); | ||
| 143 | + $data = [ | ||
| 144 | + 'project_id' => $info['project_id'], | ||
| 145 | + 'title' => $info['text']['title'], | ||
| 146 | + 'thumb'=>json_encode($info['text']['image'][0] ?? [],true), | ||
| 147 | + 'gallery'=>json_encode($info['text']['image'] ?? [],true), | ||
| 148 | + 'intro'=>$info['text']['remark'], | ||
| 149 | + 'category_id'=>$category_id ?? '', | ||
| 150 | + 'keyword_id'=>$keyword_id ?? '', | ||
| 151 | + 'status'=>0, | ||
| 152 | + ]; | ||
| 153 | + $id = $productModel->addReturnId($data); | ||
| 154 | + CategoryRelated::saveRelated($id, $info['text']['category_id'] ?? []);//分类关联 | ||
| 155 | + KeywordRelated::saveRelated($id,$info['text']['keyword_id'] ?? []);//关键字关联 | ||
| 156 | + $route = RouteMap::setRoute($data['title'],RouteMap::SOURCE_PRODUCT,$id,$info['project_id']); | ||
| 157 | + $this->model->edit(['route'=>$route],['id'=>$id]); | ||
| 158 | + }catch (\Exception $e){ | ||
| 159 | + $this->fail('保存失败,请联系管理员'); | ||
| 160 | + } | ||
| 161 | + return $this->success(); | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + /** | ||
| 165 | + * @remark :保存blog数据 | ||
| 166 | + * @name :saveBlogData | ||
| 167 | + * @author :lyh | ||
| 168 | + * @method :post | ||
| 169 | + * @time :2025/9/25 16:26 | ||
| 170 | + */ | ||
| 171 | + public function saveBlogData($info) | ||
| 172 | + { | ||
| 173 | + if(isset($info['text']['category_id']) && !empty($info['text']['category_id'])) { | ||
| 174 | + $category_id = ','.Arr::arrToSet($info['text']['category_id']).','; | ||
| 175 | + } | ||
| 176 | + if(isset($info['text']['image'])){ | ||
| 177 | + $info['text']['image'] = str_replace_url($info['text']['image'] ?? ''); | ||
| 178 | + } | ||
| 179 | + $data = [ | ||
| 180 | + 'project_id' => $info['project_id'], | ||
| 181 | + 'name' => $info['text']['title'], | ||
| 182 | + 'image'=>$info['text']['image'], | ||
| 183 | + 'text'=>$info['text']['remark'], | ||
| 184 | + 'category_id'=>$category_id ?? '', | ||
| 185 | + 'status'=>0, | ||
| 186 | + ]; | ||
| 187 | + try { | ||
| 188 | + $blogModel = new Blog(); | ||
| 189 | + $id = $blogModel->addReturnId($data); | ||
| 190 | + $route = RouteMap::setRoute($data['name'],RouteMap::SOURCE_BLOG,$id,$info['project_id']); | ||
| 191 | + $this->model->edit(['url'=>$route],['id'=>$id]); | ||
| 192 | + }catch (\Exception $e){ | ||
| 193 | + $this->fail('保存失败,请联系管理员'); | ||
| 194 | + } | ||
| 195 | + return $this->success(); | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + /** | ||
| 199 | + * @remark :保存新闻数据 | ||
| 200 | + * @name :saveNewsData | ||
| 201 | + * @author :lyh | ||
| 202 | + * @method :post | ||
| 203 | + * @time :2025/9/25 16:34 | ||
| 204 | + */ | ||
| 205 | + public function saveNewsData($info) | ||
| 206 | + { | ||
| 207 | + if(isset($info['text']['category_id']) && !empty($info['text']['category_id'])) { | ||
| 208 | + $category_id = ','.Arr::arrToSet($info['text']['category_id']).','; | ||
| 209 | + } | ||
| 210 | + if(isset($info['text']['image'])){ | ||
| 211 | + $info['text']['image'] = str_replace_url($info['text']['image'] ?? ''); | ||
| 212 | + } | ||
| 213 | + $data = [ | ||
| 214 | + 'project_id' => $info['project_id'], | ||
| 215 | + 'name' => $info['text']['title'], | ||
| 216 | + 'image'=>$info['text']['image'], | ||
| 217 | + 'text'=>$info['text']['remark'], | ||
| 218 | + 'category_id'=>$category_id ?? '', | ||
| 219 | + 'status'=>0, | ||
| 220 | + ]; | ||
| 221 | + try { | ||
| 222 | + $newsModel = new News(); | ||
| 223 | + $id = $newsModel->addReturnId($data); | ||
| 224 | + $route = RouteMap::setRoute($data['name'],RouteMap::SOURCE_NEWS,$id,$info['project_id']); | ||
| 225 | + $this->model->edit(['route'=>$route],['id'=>$id]); | ||
| 226 | + }catch (\Exception $e){ | ||
| 227 | + $this->fail('保存失败,请联系管理员'); | ||
| 228 | + } | ||
| 229 | + return $this->success(); | ||
| 230 | + } | ||
| 231 | +} |
| @@ -555,7 +555,7 @@ class RankDataLogic extends BaseLogic | @@ -555,7 +555,7 @@ class RankDataLogic extends BaseLogic | ||
| 555 | $without_extension_project_ids = [658]; //是否达标只统计主词的 | 555 | $without_extension_project_ids = [658]; //是否达标只统计主词的 |
| 556 | $extension_project_ids = [354]; //扩展词也到达标的 | 556 | $extension_project_ids = [354]; //扩展词也到达标的 |
| 557 | $compliance_project_ids = [2163,257,823,1750,497]; //直接达标处理的 | 557 | $compliance_project_ids = [2163,257,823,1750,497]; //直接达标处理的 |
| 558 | - $ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685, 3931];//暂停的项目 | 558 | + $ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685, 3931,2273,3647];//暂停的项目 |
| 559 | $uptimeProjectId = [1434,1812,276,2414,2974];//按上线时间统计的项目 | 559 | $uptimeProjectId = [1434,1812,276,2414,2974];//按上线时间统计的项目 |
| 560 | //一个项目多个api_no | 560 | //一个项目多个api_no |
| 561 | $multiple_api_no_project_ids = [ | 561 | $multiple_api_no_project_ids = [ |
app/Models/Ticket/TicketUploadData.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TicketUploadData.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/9/25 09:33 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Helper\Arr; | ||
| 13 | +use App\Models\Base; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * @remark :工单内上传数据 | ||
| 17 | + * @name :TicketUploadData | ||
| 18 | + * @author :lyh | ||
| 19 | + * @method :post | ||
| 20 | + * @time :2025/9/25 09:34 | ||
| 21 | + */ | ||
| 22 | +class TicketUploadData extends Base | ||
| 23 | +{ | ||
| 24 | + protected $table = 'gl_ticket_upload_data'; | ||
| 25 | + | ||
| 26 | + public function getTextAttribute($value){ | ||
| 27 | + if(!empty($value)){ | ||
| 28 | + $value = Arr::s2a($value); | ||
| 29 | + } | ||
| 30 | + return $value; | ||
| 31 | + } | ||
| 32 | +} |
| @@ -94,3 +94,13 @@ Route::prefix('tickets')->group(function () { | @@ -94,3 +94,13 @@ Route::prefix('tickets')->group(function () { | ||
| 94 | }); | 94 | }); |
| 95 | Route::any('/get_project_records', [\App\Http\Controllers\Api\WorkOrder\TicketController::class, 'get_project_records'])->name('tickets.get_project_records'); | 95 | Route::any('/get_project_records', [\App\Http\Controllers\Api\WorkOrder\TicketController::class, 'get_project_records'])->name('tickets.get_project_records'); |
| 96 | Route::get('/pushTicketByBot/{friend_id}', [\App\Http\Controllers\Api\WorkOrder\TicketController::class, 'pushTicketByBot'])->summary('企微群@机器人触发工单推送')->name('tickets.pushTicketByBot'); | 96 | Route::get('/pushTicketByBot/{friend_id}', [\App\Http\Controllers\Api\WorkOrder\TicketController::class, 'pushTicketByBot'])->summary('企微群@机器人触发工单推送')->name('tickets.pushTicketByBot'); |
| 97 | +//保存工单提交数据(产品,新闻,博客)详情 | ||
| 98 | +Route::prefix('ticket_upload')->group(function () { | ||
| 99 | + Route::any('/', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'lists'])->name('ticket_upload.lists'); | ||
| 100 | + Route::any('/info', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'info'])->name('ticket_upload.info'); | ||
| 101 | + Route::any('/save', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'save'])->name('ticket_upload.save'); | ||
| 102 | + Route::any('/getProductCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getProductCate'])->name('ticket_upload.getProductCate'); | ||
| 103 | + Route::any('/getBlogCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getBlogCate'])->name('ticket_upload.getBlogCate'); | ||
| 104 | + Route::any('/getNewsCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getNewsCate'])->name('ticket_upload.getNewsCate'); | ||
| 105 | +}); | ||
| 106 | + |
| @@ -644,6 +644,12 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -644,6 +644,12 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 644 | Route::any('/monthManageList', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'monthManageList'])->name('ticket_count_monthManageList');//月统计数据 | 644 | Route::any('/monthManageList', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'monthManageList'])->name('ticket_count_monthManageList');//月统计数据 |
| 645 | Route::any('/manageTicketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'manageTicketCount'])->name('ticket_count_manageTicketCount'); | 645 | Route::any('/manageTicketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'manageTicketCount'])->name('ticket_count_manageTicketCount'); |
| 646 | }); | 646 | }); |
| 647 | + //ticket | ||
| 648 | + Route::prefix('ticket_upload')->group(function () { | ||
| 649 | + Route::any('/', [Aside\Ticket\TicketUploadDataController::class,'lists'])->name('ticket_upload_lists'); | ||
| 650 | + Route::any('/save', [Aside\Ticket\TicketUploadDataController::class,'save'])->name('ticket_upload_save'); | ||
| 651 | + Route::any('/detail', [Aside\Ticket\TicketUploadDataController::class,'detail'])->name('ticket_upload_detail'); | ||
| 652 | + }); | ||
| 647 | }); | 653 | }); |
| 648 | 654 | ||
| 649 | //无需登录验证的路由组 | 655 | //无需登录验证的路由组 |
-
请 注册 或 登录 后发表评论