|
@@ -87,12 +87,14 @@ class PostRepository
|
|
|
$topicIds = implode(',', $topicIdsArray);
|
|
|
|
|
|
//验证内容字数
|
|
|
- $html = strip_tags($request['content']);
|
|
|
- if (mb_strlen($html, 'UTF8') > 1000) {
|
|
|
- return Response::create([
|
|
|
- 'message' => '所传内容不能超过1000字',
|
|
|
- 'status_code' => 500
|
|
|
- ]);
|
|
|
+ if($request['type'] != 'html'){
|
|
|
+ $html = strip_tags($request['content']);
|
|
|
+ if (mb_strlen($html, 'UTF8') > 1000) {
|
|
|
+ return Response::create([
|
|
|
+ 'message' => '所传内容不能超过1000字',
|
|
|
+ 'status_code' => 500
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$data = [
|
|
@@ -134,7 +136,7 @@ class PostRepository
|
|
|
'available_bean' => $this->availableBean(),
|
|
|
'will_collect_bean' => rand(100, 200),
|
|
|
'collect_bean' => 0,
|
|
|
- 'weight' => 0
|
|
|
+ 'weight' => 999
|
|
|
]);
|
|
|
|
|
|
if (!empty($request['imgs']) && $request['type'] == 'image') {
|
|
@@ -167,6 +169,7 @@ class PostRepository
|
|
|
'behavior_id' => $virus->virus_behavior_id,
|
|
|
'behavior_flag' => 'publish',
|
|
|
'post_id' => $post->id,
|
|
|
+ 'post_type' => $post->type,
|
|
|
'post_desc' => $desc,
|
|
|
'post_cover' => $post->img,
|
|
|
'target_id' => $post->uid,
|
|
@@ -277,6 +280,7 @@ class PostRepository
|
|
|
$data = [
|
|
|
'behavior_value' => 1,
|
|
|
'post_id' => $post->id,
|
|
|
+ 'post_type' => $post->type,
|
|
|
'post_author_uid' => $post->uid,
|
|
|
'post_desc' => $desc,
|
|
|
'post_cover' => $post->img,
|
|
@@ -410,6 +414,7 @@ class PostRepository
|
|
|
'behavior_id' => $virus->virus_behavior_id,
|
|
|
'behavior_flag' => 'comment',
|
|
|
'post_id' => $post->id,
|
|
|
+ 'post_type' => $post->type,
|
|
|
'post_author_uid' => $post->uid,
|
|
|
'post_desc' => $desc,
|
|
|
'post_cover' => $post->img,
|