Ver código fonte

Merge branch 'develop' of http://git.caihongxingqiu.net/rainbow/config-manage into develop

xielin 5 anos atrás
pai
commit
b1505fda98

+ 2 - 3
app/Http/Controllers/V2/ActivitiesController.php

@@ -44,7 +44,7 @@ class ActivitiesController extends Controller {
     }
     public function create(Request $request){
         $validator = Validator::make($request->all(), [
-            'name' => 'required|string|max:20',
+            'name' => 'required|string|max:12',
             'content' => 'required|string',
         ]);
         if ($validator->fails()) {
@@ -54,14 +54,13 @@ class ActivitiesController extends Controller {
     }
     public function edit(Request $request){
         $validator = Validator::make($request->all(), [
-            'id' => 'required|integer|max:20    ',
+            'id' => 'required|integer',
             'name' => 'required|string|max:12',
             'content' => 'required|string',
         ]);
         if ($validator->fails()) {
             return $this->response->error($validator->errors()->first(), 500);
         }
-
         return  $this->activitiesRepository->edit($request->all());
     }
     public function view(Request $request){

+ 1 - 0
app/Repositories/ActivitiesRepository.php

@@ -69,6 +69,7 @@ class ActivitiesRepository {
             ]);
         }
         $activities->content = $request['content'];
+        $activities->name = $request['name'];
         DB::beginTransaction();
         try{
             $activities->save();

+ 1 - 0
app/Transformers/MessageRuleDetailTransformer.php

@@ -33,6 +33,7 @@ class MessageRuleDetailTransformer extends TransformerAbstract
             'message_status' => $messageStatus,
             'message_show_type' => $messageRule['message_show_type'],
             'activity_time' => $messageRule['activity_time'],
+            'activity_url' => $messageRule['activity_url'],
         ];
     }
 }

+ 35 - 0
database/migrations/2019_07_18_105937_add_post_type_table_message_rule.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddPostTypeTableMessageRule extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('message_rule', function (Blueprint $table) {
+            $table->string('post_type', 16)
+                ->default('')
+                ->after('activity_url')
+                ->comment('内容类型');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('message_rule', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 12 - 12
public/config.json

@@ -10,18 +10,18 @@
     "imageInsertAlign": "none", /* 插入的图片浮动方式 */
     "imageUrlPrefix": "", /* 图片访问路径前缀 */
     "imagePathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
-                                /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
-                                /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
-                                /* {time} 会替换成时间戳 */
-                                /* {yyyy} 会替换成四位年份 */
-                                /* {yy} 会替换成两位年份 */
-                                /* {mm} 会替换成两位月份 */
-                                /* {dd} 会替换成两位日期 */
-                                /* {hh} 会替换成两位小时 */
-                                /* {ii} 会替换成两位分钟 */
-                                /* {ss} 会替换成两位秒 */
-                                /* 非法字符 \ : * ? " < > | */
-                                /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
+    /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
+    /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
+    /* {time} 会替换成时间戳 */
+    /* {yyyy} 会替换成四位年份 */
+    /* {yy} 会替换成两位年份 */
+    /* {mm} 会替换成两位月份 */
+    /* {dd} 会替换成两位日期 */
+    /* {hh} 会替换成两位小时 */
+    /* {ii} 会替换成两位分钟 */
+    /* {ss} 会替换成两位秒 */
+    /* 非法字符 \ : * ? " < > | */
+    /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
 
     /* 涂鸦图片上传配置项 */
     "scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */