作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2858
@@ -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);
@@ -59,12 +59,12 @@ class TicketUploadDataLogic extends BaseLogic @@ -59,12 +59,12 @@ class TicketUploadDataLogic extends BaseLogic
59 if($v['type'] == 1){ 59 if($v['type'] == 1){
60 if(!empty($v['text']['image'])){ 60 if(!empty($v['text']['image'])){
61 foreach ($v['text']['image'] as $gallery_k => $gallery_v){ 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']); 62 + $gallery_v['url'] = getImageUrl($gallery_v['url']);
63 $info['text']['image'][$gallery_k] = $gallery_v; 63 $info['text']['image'][$gallery_k] = $gallery_v;
64 } 64 }
65 } 65 }
66 }else{ 66 }else{
67 - $v['text']['image'] = getImageUrl($v['text']['image'],$this->user['storage_type'],$this->user['project_location']); 67 + $v['text']['image'] = getImageUrl($v['text']['image']);
68 } 68 }
69 return $this->success($v); 69 return $this->success($v);
70 } 70 }
@@ -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['is_match'] = ['!=',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关键词不能超过200个字符',
  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