作者 赵彬吉
@@ -50,10 +50,41 @@ class TicketUploadDataController extends BaseController @@ -50,10 +50,41 @@ class TicketUploadDataController extends BaseController
50 'project_id.required' => 'project_id不能为空', 50 'project_id.required' => 'project_id不能为空',
51 ]); 51 ]);
52 $data = $this->model->lists($this->map, $this->page, $this->row, $this->order); 52 $data = $this->model->lists($this->map, $this->page, $this->row, $this->order);
  53 + if(!empty($data) && !empty($data['list'])){
  54 + foreach ($data['list'] as &$item) {
  55 + $item['text']['cate_name'] = $this->cateText($item['type'],$item['text']['category_id'] ?? []);
  56 + }
  57 + }
53 $this->response('success', Code::SUCCESS, $data); 58 $this->response('success', Code::SUCCESS, $data);
54 } 59 }
55 60
56 /** 61 /**
  62 + * @remark :获取分类名称
  63 + * @name :cateText
  64 + * @author :lyh
  65 + * @method :post
  66 + * @time :2025/9/29 17:18
  67 + */
  68 + public function cateText($type,$category_id)
  69 + {
  70 + if(!empty($category_id)){
  71 + return '';
  72 + }else{
  73 + $filed = 'name';
  74 + if($type == 1){
  75 + $cateModel = new Category();
  76 + $filed = 'title';
  77 + }elseif ($type == 2){
  78 + $cateModel = new BlogCategory();
  79 + }else{
  80 + $cateModel = new NewsCategory();
  81 + }
  82 + $cateArr = $cateModel->selectField(['id'=>['in',$category_id]],$filed);
  83 + return implode(',',$cateArr);
  84 + }
  85 + }
  86 +
  87 + /**
57 * @remark :获取数据详情 88 * @remark :获取数据详情
58 * @name :info 89 * @name :info
59 * @author :lyh 90 * @author :lyh
@@ -91,14 +122,25 @@ class TicketUploadDataController extends BaseController @@ -91,14 +122,25 @@ class TicketUploadDataController extends BaseController
91 ]); 122 ]);
92 //验证当前数据是否已提交 123 //验证当前数据是否已提交
93 $this->param['text'] = json_encode($this->param['text'], true); 124 $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']; 125 + if(isset($this->param['id']) && !empty($this->param['id'])){
  126 + //执行编辑
  127 + $info = $this->model->read(['id'=>$this->param['id']]);
  128 + if($info['status'] == 0){
  129 + $this->model->edit($this->param,['id'=>$this->param['id']]);
  130 + }else{
  131 + $this->response('当前状态不允许编辑', Code::SYSTEM_ERROR);
  132 + }
  133 + $this->response('success');
  134 + }else{
  135 + $info = $this->model->read(['project_id' => $this->param['project_id'], 'type' => $this->param['type'], 'text' => $this->param['text'], 'status' => 0]);
  136 + if ($info === false) {
  137 + $id = $this->model->addReturnId($this->param);
  138 + } else {
  139 + $id = $info['id'];
  140 + }
  141 + $data = ['id' => $id];
  142 + $this->response('success', Code::SUCCESS, $data);
99 } 143 }
100 - $data = ['id' => $id];  
101 - $this->response('success', Code::SUCCESS, $data);  
102 } 144 }
103 145
104 /** 146 /**
@@ -123,10 +165,10 @@ class TicketUploadDataController extends BaseController @@ -123,10 +165,10 @@ class TicketUploadDataController extends BaseController
123 if ($this->param['type'] == 1) { 165 if ($this->param['type'] == 1) {
124 //todo::搜索获取分类 166 //todo::搜索获取分类
125 $productCateModel = new Category(); 167 $productCateModel = new Category();
126 - $data = $productCateModel->lists(['title' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); 168 + $data = $productCateModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
127 } else { 169 } else {
128 $keywordModel = new Keyword(); 170 $keywordModel = new Keyword();
129 - $data = $keywordModel->lists(['title' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); 171 + $data = $keywordModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
130 } 172 }
131 DB::disconnect('custom_mysql'); 173 DB::disconnect('custom_mysql');
132 $this->response('success', Code::SUCCESS, $data); 174 $this->response('success', Code::SUCCESS, $data);
@@ -150,7 +192,7 @@ class TicketUploadDataController extends BaseController @@ -150,7 +192,7 @@ class TicketUploadDataController extends BaseController
150 ]); 192 ]);
151 ProjectServer::useProject($this->param['project_id']); 193 ProjectServer::useProject($this->param['project_id']);
152 $blogCateModel = new BlogCategory(); 194 $blogCateModel = new BlogCategory();
153 - $data = $blogCateModel->lists(['name' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); 195 + $data = $blogCateModel->lists(['name' => ['like' ,'%' . $this->param['search'] . '%']], 1, 20,'id',['id','name']);
154 DB::disconnect('custom_mysql'); 196 DB::disconnect('custom_mysql');
155 $this->response('success', Code::SUCCESS, $data); 197 $this->response('success', Code::SUCCESS, $data);
156 } 198 }
@@ -173,7 +215,7 @@ class TicketUploadDataController extends BaseController @@ -173,7 +215,7 @@ class TicketUploadDataController extends BaseController
173 ]); 215 ]);
174 ProjectServer::useProject($this->param['project_id']); 216 ProjectServer::useProject($this->param['project_id']);
175 $newsCateModel = new NewsCategory(); 217 $newsCateModel = new NewsCategory();
176 - $data = $newsCateModel->lists(['name' => ['like' => '%' . $this->param['search'] . '%']], 1, 20); 218 + $data = $newsCateModel->lists(['name' => ['like' , '%' . $this->param['search'] . '%']], 1, 20,'id',['id','name']);
177 DB::disconnect('custom_mysql'); 219 DB::disconnect('custom_mysql');
178 $this->response('success', Code::SUCCESS, $data); 220 $this->response('success', Code::SUCCESS, $data);
179 } 221 }
@@ -37,6 +37,11 @@ class TicketUploadDataController extends BaseController @@ -37,6 +37,11 @@ class TicketUploadDataController extends BaseController
37 * @time :2025/9/25 14:02 37 * @time :2025/9/25 14:02
38 */ 38 */
39 public function lists(){ 39 public function lists(){
  40 + $this->request->validate([
  41 + 'project_id'=>'required'
  42 + ],[
  43 + 'project_id.required' => 'project_id不能为空',
  44 + ]);
40 if(isset($this->map['text']) && !empty($this->map['text'])){ 45 if(isset($this->map['text']) && !empty($this->map['text'])){
41 $this->map['text'] = ['like','%'.$this->map['text'].'%']; 46 $this->map['text'] = ['like','%'.$this->map['text'].'%'];
42 } 47 }
@@ -82,8 +82,8 @@ class AiBlogController extends BaseController @@ -82,8 +82,8 @@ class AiBlogController extends BaseController
82 * @method :post 82 * @method :post
83 * @time :2023/7/5 14:33 83 * @time :2023/7/5 14:33
84 */ 84 */
85 - public function save(AiBlogLogic $aiBlogLogic){  
86 -// $aiBlogRequest->validated(); 85 + public function save(AiBlogRequest $aiBlogRequest,AiBlogLogic $aiBlogLogic){
  86 + $aiBlogRequest->validated();
87 $aiBlogLogic->blogSave(); 87 $aiBlogLogic->blogSave();
88 $this->response('success'); 88 $this->response('success');
89 } 89 }
@@ -218,14 +218,15 @@ class BlogController extends BaseController @@ -218,14 +218,15 @@ class BlogController extends BaseController
218 public function edit_seo(BlogLogic $blogLogic){ 218 public function edit_seo(BlogLogic $blogLogic){
219 $this->request->validate([ 219 $this->request->validate([
220 'id'=>['required'], 220 'id'=>['required'],
221 - 'seo_title'=>['required'],  
222 - 'seo_description'=>['required'],  
223 - 'seo_keywords'=>['required'], 221 + 'seo_title'=>['required','max:70'],
  222 + 'seo_description'=>['required','max:200'],
  223 + 'seo_keywords'=>['required','max:200'],
224 ],[ 224 ],[
225 'id.required' => 'ID不能为空', 225 'id.required' => 'ID不能为空',
226 'seo_title.required' => 'seo_title不能为空', 226 'seo_title.required' => 'seo_title不能为空',
227 'seo_description.required' => 'seo_description不能为空', 227 'seo_description.required' => 'seo_description不能为空',
228 'seo_keywords.required' => 'seo_description不能为空', 228 'seo_keywords.required' => 'seo_description不能为空',
  229 + 'seo_title.max' => 'seo_title不能超过70个字符',
229 ]); 230 ]);
230 $blogLogic->edit_seo(); 231 $blogLogic->edit_seo();
231 $this->response('success'); 232 $this->response('success');
@@ -200,11 +200,17 @@ class CustomModuleContentController extends BaseController @@ -200,11 +200,17 @@ class CustomModuleContentController extends BaseController
200 $this->request->validate([ 200 $this->request->validate([
201 'name'=>['required'], 201 'name'=>['required'],
202 'route'=>['required'], 202 'route'=>['required'],
203 - 'module_id'=>['required'] 203 + 'module_id'=>['required'],
  204 + 'seo_title'=>['max:70'],
  205 + 'seo_keywords'=>['max:200'],
  206 + 'seo_description'=>['max:200'],
204 ],[ 207 ],[
205 'name.required' => '分类名称不能为空', 208 'name.required' => '分类名称不能为空',
206 'route.required' => '分类路由不能为空', 209 'route.required' => '分类路由不能为空',
207 - 'module_id.required' => '所选模块id不能为空' 210 + 'module_id.required' => '所选模块id不能为空',
  211 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  212 + 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
  213 + 'seo_description.max' => 'SEO描述不能超过200个字符',
208 ]); 214 ]);
209 $data = $logic->contentSave(); 215 $data = $logic->contentSave();
210 $this->response('success',Code::SUCCESS,$data); 216 $this->response('success',Code::SUCCESS,$data);
@@ -211,14 +211,8 @@ class NewsController extends BaseController @@ -211,14 +211,8 @@ class NewsController extends BaseController
211 public function edit_seo(NewsLogic $newsLogic){ 211 public function edit_seo(NewsLogic $newsLogic){
212 $this->request->validate([ 212 $this->request->validate([
213 'id'=>['required'], 213 'id'=>['required'],
214 - 'seo_title'=>['required'],  
215 - 'seo_description'=>['required'],  
216 - 'seo_keywords'=>['required'],  
217 ],[ 214 ],[
218 'id.required' => 'ID不能为空', 215 'id.required' => 'ID不能为空',
219 - 'seo_title.required' => 'seo_title不能为空',  
220 - 'seo_description.required' => 'seo_description不能为空',  
221 - 'seo_keywords.required' => 'seo_description不能为空',  
222 ]); 216 ]);
223 $newsLogic->edit_seo(); 217 $newsLogic->edit_seo();
224 $this->response('success'); 218 $this->response('success');
@@ -12,7 +12,10 @@ namespace App\Http\Logic\Aside\Ticket; @@ -12,7 +12,10 @@ namespace App\Http\Logic\Aside\Ticket;
12 use App\Helper\Arr; 12 use App\Helper\Arr;
13 use App\Http\Logic\Aside\BaseLogic; 13 use App\Http\Logic\Aside\BaseLogic;
14 use App\Models\Blog\Blog; 14 use App\Models\Blog\Blog;
  15 +use App\Models\Blog\BlogCategory;
15 use App\Models\News\News; 16 use App\Models\News\News;
  17 +use App\Models\News\NewsCategory;
  18 +use App\Models\Product\Category;
16 use App\Models\Product\CategoryRelated; 19 use App\Models\Product\CategoryRelated;
17 use App\Models\Product\KeywordRelated; 20 use App\Models\Product\KeywordRelated;
18 use App\Models\Product\Product; 21 use App\Models\Product\Product;
@@ -41,10 +44,15 @@ class TicketUploadDataLogic extends BaseLogic @@ -41,10 +44,15 @@ class TicketUploadDataLogic extends BaseLogic
41 if(isset($this->map['text']) && !empty($this->map['text'])){ 44 if(isset($this->map['text']) && !empty($this->map['text'])){
42 $this->map['text'] = ['like','%'.$this->map['text'].'%']; 45 $this->map['text'] = ['like','%'.$this->map['text'].'%'];
43 } 46 }
  47 + ProjectServer::useProject($map['project_id']);
44 $data = $this->model->lists($map,$page,$row,$order); 48 $data = $this->model->lists($map,$page,$row,$order);
45 - foreach ($data as &$v){  
46 - $v = $this->getHandleFileImage($v); 49 + if(!empty($data) && !empty($data['list'])){
  50 + foreach ($data['list'] as &$v){
  51 + $v = $this->getHandleFileImage($v);
  52 + $v['text']['cate_text'] = $this->cateText($v['type'],$v['text']['category_id'] ?? []);
  53 + }
47 } 54 }
  55 + DB::disconnect('custom_mysql');
48 return $this->success($data); 56 return $this->success($data);
49 } 57 }
50 58
@@ -59,17 +67,43 @@ class TicketUploadDataLogic extends BaseLogic @@ -59,17 +67,43 @@ class TicketUploadDataLogic extends BaseLogic
59 if($v['type'] == 1){ 67 if($v['type'] == 1){
60 if(!empty($v['text']['image'])){ 68 if(!empty($v['text']['image'])){
61 foreach ($v['text']['image'] as $gallery_k => $gallery_v){ 69 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']); 70 + $gallery_v['url'] = getImageUrl($gallery_v['url']);
63 $info['text']['image'][$gallery_k] = $gallery_v; 71 $info['text']['image'][$gallery_k] = $gallery_v;
64 } 72 }
65 } 73 }
66 }else{ 74 }else{
67 - $v['text']['image'] = getImageUrl($v['text']['image'],$this->user['storage_type'],$this->user['project_location']); 75 + $v['text']['image'] = getImageUrl($v['text']['image']);
68 } 76 }
69 return $this->success($v); 77 return $this->success($v);
70 } 78 }
71 79
72 /** 80 /**
  81 + * @remark :获取分类名称
  82 + * @name :cateText
  83 + * @author :lyh
  84 + * @method :post
  85 + * @time :2025/9/29 17:18
  86 + */
  87 + public function cateText($type,$category_id)
  88 + {
  89 + if(!empty($category_id)){
  90 + return '';
  91 + }else{
  92 + $filed = 'name';
  93 + if($type == 1){
  94 + $cateModel = new Category();
  95 + $filed = 'title';
  96 + }elseif ($type == 2){
  97 + $cateModel = new BlogCategory();
  98 + }else{
  99 + $cateModel = new NewsCategory();
  100 + }
  101 + $cateArr = $cateModel->selectField(['id'=>['in',$category_id]],$filed);
  102 + return implode(',',$cateArr);
  103 + }
  104 + }
  105 +
  106 + /**
73 * @remark :获取当前数据详情 107 * @remark :获取当前数据详情
74 * @name :getDetail 108 * @name :getDetail
75 * @author :lyh 109 * @author :lyh
@@ -49,6 +49,7 @@ class GeoQuestionResLogic extends BaseLogic @@ -49,6 +49,7 @@ class GeoQuestionResLogic extends BaseLogic
49 public function getResultList($map = [],$page = 1,$row = 20,$order = 'created_at',$sort = 'desc'){ 49 public function getResultList($map = [],$page = 1,$row = 20,$order = 'created_at',$sort = 'desc'){
50 unset($map['sort']); 50 unset($map['sort']);
51 $map['project_id'] = $this->user['project_id']; 51 $map['project_id'] = $this->user['project_id'];
  52 + $map['hit'] = ['!=',0];
52 $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','label','cosine','created_at','updated_at']; 53 $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','label','cosine','created_at','updated_at'];
53 if(!empty($map['created_at'])){ 54 if(!empty($map['created_at'])){
54 $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']]; 55 $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']];
@@ -25,6 +25,9 @@ class AiBlogRequest extends FormRequest @@ -25,6 +25,9 @@ class AiBlogRequest extends FormRequest
25 { 25 {
26 return [ 26 return [
27 'new_title'=>'required', 27 'new_title'=>'required',
  28 + 'seo_title'=>'max:70',
  29 + 'seo_keywords'=>'max:200',
  30 + 'seo_description'=>'max:200',
28 ]; 31 ];
29 } 32 }
30 33
@@ -32,6 +35,9 @@ class AiBlogRequest extends FormRequest @@ -32,6 +35,9 @@ class AiBlogRequest extends FormRequest
32 { 35 {
33 return [ 36 return [
34 'new_title.required' => '新标题不能为空', 37 'new_title.required' => '新标题不能为空',
  38 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  39 + 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
  40 + 'seo_description.max' => 'SEO描述不能超过200个字符',
35 ]; 41 ];
36 } 42 }
37 } 43 }
@@ -24,7 +24,10 @@ class BlogCategoryRequest extends FormRequest @@ -24,7 +24,10 @@ class BlogCategoryRequest extends FormRequest
24 public function rules() 24 public function rules()
25 { 25 {
26 return [ 26 return [
27 - 'name'=>'required|max:100', 27 + 'name'=>'required|max:200',
  28 + 'seo_title'=>'max:70',
  29 + 'seo_keywords'=>'max:200',
  30 + 'seo_description'=>'max:200',
28 ]; 31 ];
29 } 32 }
30 33
@@ -32,7 +35,10 @@ class BlogCategoryRequest extends FormRequest @@ -32,7 +35,10 @@ class BlogCategoryRequest extends FormRequest
32 { 35 {
33 return [ 36 return [
34 'name.required'=>'请填写名称', 37 'name.required'=>'请填写名称',
35 - 'name.max'=>'名称最大100字', 38 + 'name.max'=>'名称最大200字',
  39 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  40 + 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
  41 + 'seo_description.max' => 'SEO描述不能超过200个字符',
36 ]; 42 ];
37 } 43 }
38 } 44 }
@@ -25,9 +25,11 @@ class BlogRequest extends FormRequest @@ -25,9 +25,11 @@ class BlogRequest extends FormRequest
25 { 25 {
26 return [ 26 return [
27 'name'=>'required|max:200', 27 'name'=>'required|max:200',
28 - 'seo_keywords'=>'max:500',  
29 'remark'=>'max:1000', 28 'remark'=>'max:1000',
30 'url'=>'required', 29 'url'=>'required',
  30 + 'seo_title'=>'max:70',
  31 + 'seo_keywords'=>'max:200',
  32 + 'seo_description'=>'max:200',
31 // 'text'=>'max:5000', 33 // 'text'=>'max:5000',
32 ]; 34 ];
33 } 35 }
@@ -38,7 +40,9 @@ class BlogRequest extends FormRequest @@ -38,7 +40,9 @@ class BlogRequest extends FormRequest
38 'name.required'=>'请填写名称', 40 'name.required'=>'请填写名称',
39 'name.max'=>'名称超过最长长度200', 41 'name.max'=>'名称超过最长长度200',
40 'url.required'=>'链接不能为空', 42 'url.required'=>'链接不能为空',
41 - 'seo_keywords.max'=>'seo_keywords太长,请重新编辑', 43 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  44 + 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
  45 + 'seo_description.max' => 'SEO描述不能超过200个字符',
42 'remark.max'=>'描述超过最长长度1000', 46 'remark.max'=>'描述超过最长长度1000',
43 // 'text.max'=>'详情内容超过最大长度', 47 // 'text.max'=>'详情内容超过最大长度',
44 ]; 48 ];
@@ -24,7 +24,10 @@ class NewsCategoryRequest extends FormRequest @@ -24,7 +24,10 @@ class NewsCategoryRequest extends FormRequest
24 public function rules() 24 public function rules()
25 { 25 {
26 return [ 26 return [
27 - 'name'=>'required|max:100', 27 + 'name'=>'required|max:200',
  28 + 'seo_title'=>'max:70',
  29 + 'seo_keywords'=>'max:200',
  30 + 'seo_description'=>'max:200',
28 ]; 31 ];
29 } 32 }
30 33
@@ -33,6 +36,9 @@ class NewsCategoryRequest extends FormRequest @@ -33,6 +36,9 @@ class NewsCategoryRequest extends FormRequest
33 return [ 36 return [
34 'name.required'=>'请填写名称', 37 'name.required'=>'请填写名称',
35 'name.max'=>'名称最大100字', 38 'name.max'=>'名称最大100字',
  39 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  40 + 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
  41 + 'seo_description.max' => 'SEO描述不能超过200个字符',
36 ]; 42 ];
37 } 43 }
38 } 44 }
@@ -27,6 +27,9 @@ class NewsRequest extends FormRequest @@ -27,6 +27,9 @@ class NewsRequest extends FormRequest
27 'name'=>'required|max:200', 27 'name'=>'required|max:200',
28 // 'remark'=>'max:2000', 28 // 'remark'=>'max:2000',
29 'url'=>'required', 29 'url'=>'required',
  30 + 'seo_title' => 'max:70',
  31 + 'seo_keywords' => 'max:200',
  32 + 'seo_description' => 'max:200',
30 ]; 33 ];
31 } 34 }
32 35
@@ -37,6 +40,9 @@ class NewsRequest extends FormRequest @@ -37,6 +40,9 @@ class NewsRequest extends FormRequest
37 'name.max'=>'名称超过最长长度200', 40 'name.max'=>'名称超过最长长度200',
38 'url.required'=>'链接不能为空', 41 'url.required'=>'链接不能为空',
39 // 'remark.max'=>'描述超过最长长度2000' 42 // 'remark.max'=>'描述超过最长长度2000'
  43 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  44 + 'seo_keywords.max' => 'SEO关键词不能超过300个字符',
  45 + 'seo_description.max' => 'SEO描述不能超过200个字符',
40 ]; 46 ];
41 } 47 }
42 } 48 }
@@ -31,9 +31,9 @@ class KeywordRequest extends FormRequest @@ -31,9 +31,9 @@ class KeywordRequest extends FormRequest
31 { 31 {
32 return [ 32 return [
33 'title'=>'required|max:200', 33 'title'=>'required|max:200',
34 - 'seo_title'=>'max:255',  
35 - 'seo_keywords'=>'max:500',  
36 - 'seo_description'=>'max:500', 34 + 'seo_title'=>'max:70',
  35 + 'seo_keywords'=>'max:200',
  36 + 'seo_description'=>'max:200',
37 'related_news_ids'=>'array|max:2', 37 'related_news_ids'=>'array|max:2',
38 'related_blog_ids'=>'array|max:2', 38 'related_blog_ids'=>'array|max:2',
39 ]; 39 ];
@@ -44,9 +44,9 @@ class KeywordRequest extends FormRequest @@ -44,9 +44,9 @@ class KeywordRequest extends FormRequest
44 return [ 44 return [
45 'title.required' => '请输入关键词', 45 'title.required' => '请输入关键词',
46 'title.max' => '关键词不能超过200个字符', 46 'title.max' => '关键词不能超过200个字符',
47 - 'seo_title.max' => 'SEO标题不能超过255个字符',  
48 - 'seo_keywords.max' => 'SEO关键词不能超过500个字符',  
49 - 'seo_description.max' => 'SEO描述不能超过500个字符', 47 + 'seo_title.max' => 'SEO标题不能超过70个字符',
  48 + 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
  49 + 'seo_description.max' => 'SEO描述不能超过200个字符',
50 'related_news_ids.max' => '关联新闻不能超过两条', 50 'related_news_ids.max' => '关联新闻不能超过两条',
51 'related_blog_ids.max' => '关联博客不能超过两条', 51 'related_blog_ids.max' => '关联博客不能超过两条',
52 ]; 52 ];
@@ -38,6 +38,9 @@ class ProductRequest extends FormRequest @@ -38,6 +38,9 @@ class ProductRequest extends FormRequest
38 return [ 38 return [
39 'title' => 'required|max:200', 39 'title' => 'required|max:200',
40 'route' => 'required|max:200', 40 'route' => 'required|max:200',
  41 + 'seo_mate.title' => 'max:70',
  42 + 'seo_mate.keyword' => 'max:200',
  43 + 'seo_mate.description' => 'max:200',
41 'status' => ['required', Rule::in(array_keys(Product::statusMap()))], 44 'status' => ['required', Rule::in(array_keys(Product::statusMap()))],
42 ]; 45 ];
43 } 46 }
@@ -51,6 +54,10 @@ class ProductRequest extends FormRequest @@ -51,6 +54,10 @@ class ProductRequest extends FormRequest
51 'route.max' => '产品链接不能超过200个字符', 54 'route.max' => '产品链接不能超过200个字符',
52 'status.required' => '请选择产品状态', 55 'status.required' => '请选择产品状态',
53 'status.in' => '产品状态值异常', 56 'status.in' => '产品状态值异常',
  57 + // 可选的 seo_mate 子字段的提示
  58 + 'seo_mate.title.max' => 'SEO 标题不能超过70个字符',
  59 + 'seo_mate.keyword.max' => 'SEO 关键字不能超过200个字符',
  60 + 'seo_mate.description.max' => 'SEO 描述不能超过200个字符',
54 ]; 61 ];
55 } 62 }
56 63