作者 lyh

变更数据

@@ -218,15 +218,8 @@ class BlogController extends BaseController @@ -218,15 +218,8 @@ 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','max:70'],  
222 - 'seo_description'=>['required','max:200'],  
223 - 'seo_keywords'=>['required','max:200'],  
224 ],[ 221 ],[
225 'id.required' => 'ID不能为空', 222 'id.required' => 'ID不能为空',
226 - 'seo_title.required' => 'seo_title不能为空',  
227 - 'seo_description.required' => 'seo_description不能为空',  
228 - 'seo_keywords.required' => 'seo_description不能为空',  
229 - 'seo_title.max' => 'seo_title不能超过70个字符',  
230 ]); 223 ]);
231 $blogLogic->edit_seo(); 224 $blogLogic->edit_seo();
232 $this->response('success'); 225 $this->response('success');
@@ -201,14 +201,14 @@ class CustomModuleContentController extends BaseController @@ -201,14 +201,14 @@ class CustomModuleContentController extends BaseController
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'], 204 +// 'seo_title'=>['max:70'],
205 'seo_keywords'=>['max:200'], 205 'seo_keywords'=>['max:200'],
206 'seo_description'=>['max:200'], 206 'seo_description'=>['max:200'],
207 ],[ 207 ],[
208 'name.required' => '分类名称不能为空', 208 'name.required' => '分类名称不能为空',
209 'route.required' => '分类路由不能为空', 209 'route.required' => '分类路由不能为空',
210 'module_id.required' => '所选模块id不能为空', 210 'module_id.required' => '所选模块id不能为空',
211 - 'seo_title.max' => 'SEO标题不能超过70个字符', 211 +// 'seo_title.max' => 'SEO标题不能超过70个字符',
212 'seo_keywords.max' => 'SEO关键词不能超过200个字符', 212 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
213 'seo_description.max' => 'SEO描述不能超过200个字符', 213 'seo_description.max' => 'SEO描述不能超过200个字符',
214 ]); 214 ]);
@@ -44,6 +44,9 @@ class ProductLogic extends BaseLogic @@ -44,6 +44,9 @@ class ProductLogic extends BaseLogic
44 if(isset($this->param['id']) && !empty($this->param['id'])){ 44 if(isset($this->param['id']) && !empty($this->param['id'])){
45 $data = $this->editProduct(); 45 $data = $this->editProduct();
46 }else{ 46 }else{
  47 + if(!isset($this->param['seo_title']) || empty($this->param['seo_title'])){
  48 + $this->param['seo_title'] = $this->param['title'];
  49 + }
47 $data = $this->addProduct(); 50 $data = $this->addProduct();
48 } 51 }
49 CategoryRelated::saveRelated($data['id'], $this->param['category_id'] ?? []);//分类关联 52 CategoryRelated::saveRelated($data['id'], $this->param['category_id'] ?? []);//分类关联
@@ -25,7 +25,7 @@ class AiBlogRequest extends FormRequest @@ -25,7 +25,7 @@ class AiBlogRequest extends FormRequest
25 { 25 {
26 return [ 26 return [
27 'new_title'=>'required', 27 'new_title'=>'required',
28 - 'seo_title'=>'max:70', 28 +// 'seo_title'=>'max:70',
29 'seo_keywords'=>'max:200', 29 'seo_keywords'=>'max:200',
30 'seo_description'=>'max:200', 30 'seo_description'=>'max:200',
31 ]; 31 ];
@@ -35,7 +35,7 @@ class AiBlogRequest extends FormRequest @@ -35,7 +35,7 @@ class AiBlogRequest extends FormRequest
35 { 35 {
36 return [ 36 return [
37 'new_title.required' => '新标题不能为空', 37 'new_title.required' => '新标题不能为空',
38 - 'seo_title.max' => 'SEO标题不能超过70个字符', 38 +// 'seo_title.max' => 'SEO标题不能超过70个字符',
39 'seo_keywords.max' => 'SEO关键词不能超过200个字符', 39 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
40 'seo_description.max' => 'SEO描述不能超过200个字符', 40 'seo_description.max' => 'SEO描述不能超过200个字符',
41 ]; 41 ];
@@ -27,7 +27,7 @@ class BlogRequest extends FormRequest @@ -27,7 +27,7 @@ class BlogRequest extends FormRequest
27 'name'=>'required|max:200', 27 'name'=>'required|max:200',
28 'remark'=>'max:1000', 28 'remark'=>'max:1000',
29 'url'=>'required', 29 'url'=>'required',
30 - 'seo_title'=>'max:70', 30 +// 'seo_title'=>'max:70',
31 'seo_keywords'=>'max:200', 31 'seo_keywords'=>'max:200',
32 'seo_description'=>'max:200', 32 'seo_description'=>'max:200',
33 // 'text'=>'max:5000', 33 // 'text'=>'max:5000',
@@ -40,7 +40,7 @@ class BlogRequest extends FormRequest @@ -40,7 +40,7 @@ class BlogRequest extends FormRequest
40 'name.required'=>'请填写名称', 40 'name.required'=>'请填写名称',
41 'name.max'=>'名称超过最长长度200', 41 'name.max'=>'名称超过最长长度200',
42 'url.required'=>'链接不能为空', 42 'url.required'=>'链接不能为空',
43 - 'seo_title.max' => 'SEO标题不能超过70个字符', 43 +// 'seo_title.max' => 'SEO标题不能超过70个字符',
44 'seo_keywords.max' => 'SEO关键词不能超过200个字符', 44 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
45 'seo_description.max' => 'SEO描述不能超过200个字符', 45 'seo_description.max' => 'SEO描述不能超过200个字符',
46 'remark.max'=>'描述超过最长长度1000', 46 'remark.max'=>'描述超过最长长度1000',
@@ -25,7 +25,7 @@ class NewsCategoryRequest extends FormRequest @@ -25,7 +25,7 @@ class NewsCategoryRequest extends FormRequest
25 { 25 {
26 return [ 26 return [
27 'name'=>'required|max:200', 27 'name'=>'required|max:200',
28 - 'seo_title'=>'max:70', 28 +// 'seo_title'=>'max:70',
29 'seo_keywords'=>'max:200', 29 'seo_keywords'=>'max:200',
30 'seo_description'=>'max:200', 30 'seo_description'=>'max:200',
31 ]; 31 ];
@@ -36,7 +36,7 @@ class NewsCategoryRequest extends FormRequest @@ -36,7 +36,7 @@ class NewsCategoryRequest extends FormRequest
36 return [ 36 return [
37 'name.required'=>'请填写名称', 37 'name.required'=>'请填写名称',
38 'name.max'=>'名称最大100字', 38 'name.max'=>'名称最大100字',
39 - 'seo_title.max' => 'SEO标题不能超过70个字符', 39 +// 'seo_title.max' => 'SEO标题不能超过70个字符',
40 'seo_keywords.max' => 'SEO关键词不能超过200个字符', 40 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
41 'seo_description.max' => 'SEO描述不能超过200个字符', 41 'seo_description.max' => 'SEO描述不能超过200个字符',
42 ]; 42 ];
@@ -27,7 +27,7 @@ class NewsRequest extends FormRequest @@ -27,7 +27,7 @@ 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', 30 +// 'seo_title' => 'max:70',
31 'seo_keywords' => 'max:200', 31 'seo_keywords' => 'max:200',
32 'seo_description' => 'max:200', 32 'seo_description' => 'max:200',
33 ]; 33 ];
@@ -40,7 +40,7 @@ class NewsRequest extends FormRequest @@ -40,7 +40,7 @@ class NewsRequest extends FormRequest
40 'name.max'=>'名称超过最长长度200', 40 'name.max'=>'名称超过最长长度200',
41 'url.required'=>'链接不能为空', 41 'url.required'=>'链接不能为空',
42 // 'remark.max'=>'描述超过最长长度2000' 42 // 'remark.max'=>'描述超过最长长度2000'
43 - 'seo_title.max' => 'SEO标题不能超过70个字符', 43 +// 'seo_title.max' => 'SEO标题不能超过70个字符',
44 'seo_keywords.max' => 'SEO关键词不能超过300个字符', 44 'seo_keywords.max' => 'SEO关键词不能超过300个字符',
45 'seo_description.max' => 'SEO描述不能超过200个字符', 45 'seo_description.max' => 'SEO描述不能超过200个字符',
46 ]; 46 ];
@@ -31,7 +31,7 @@ class KeywordRequest extends FormRequest @@ -31,7 +31,7 @@ class KeywordRequest extends FormRequest
31 { 31 {
32 return [ 32 return [
33 'title'=>'required|max:200', 33 'title'=>'required|max:200',
34 - 'seo_title'=>'max:70', 34 +// 'seo_title'=>'max:70',
35 'seo_keywords'=>'max:200', 35 'seo_keywords'=>'max:200',
36 'seo_description'=>'max:200', 36 'seo_description'=>'max:200',
37 'related_news_ids'=>'array|max:2', 37 'related_news_ids'=>'array|max:2',
@@ -44,7 +44,7 @@ class KeywordRequest extends FormRequest @@ -44,7 +44,7 @@ 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标题不能超过70个字符', 47 +// 'seo_title.max' => 'SEO标题不能超过70个字符',
48 'seo_keywords.max' => 'SEO关键词不能超过200个字符', 48 'seo_keywords.max' => 'SEO关键词不能超过200个字符',
49 'seo_description.max' => 'SEO描述不能超过200个字符', 49 'seo_description.max' => 'SEO描述不能超过200个字符',
50 'related_news_ids.max' => '关联新闻不能超过两条', 50 'related_news_ids.max' => '关联新闻不能超过两条',
@@ -38,8 +38,7 @@ class ProductRequest extends FormRequest @@ -38,8 +38,7 @@ 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', 41 + 'seo_mate.keywords' => 'max:300',
43 'seo_mate.description' => 'max:200', 42 'seo_mate.description' => 'max:200',
44 'status' => ['required', Rule::in(array_keys(Product::statusMap()))], 43 'status' => ['required', Rule::in(array_keys(Product::statusMap()))],
45 ]; 44 ];
@@ -55,8 +54,7 @@ class ProductRequest extends FormRequest @@ -55,8 +54,7 @@ class ProductRequest extends FormRequest
55 'status.required' => '请选择产品状态', 54 'status.required' => '请选择产品状态',
56 'status.in' => '产品状态值异常', 55 'status.in' => '产品状态值异常',
57 // 可选的 seo_mate 子字段的提示 56 // 可选的 seo_mate 子字段的提示
58 - 'seo_mate.title.max' => 'SEO 标题不能超过70个字符',  
59 - 'seo_mate.keyword.max' => 'SEO 关键字不能超过200个字符', 57 + 'seo_mate.keywords.max' => 'SEO 关键字不能超过200个字符',
60 'seo_mate.description.max' => 'SEO 描述不能超过200个字符', 58 'seo_mate.description.max' => 'SEO 描述不能超过200个字符',
61 ]; 59 ];
62 } 60 }