PostRepositories.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: edz
  5. * Date: 2019-06-10
  6. * Time: 17:53
  7. */
  8. namespace App\Repositories;
  9. use App\Models\Behavior;
  10. use App\Models\Post;
  11. use App\Models\PostCollect;
  12. use App\Models\PostComment;
  13. use App\Models\PostData;
  14. use App\Models\PostDislike;
  15. use App\Models\PostImgs;
  16. use App\Models\PostLike;
  17. use App\Models\PostLog;
  18. use App\Models\PostShare;
  19. use App\Models\Topic;
  20. use App\Service\AliYunVodService;
  21. use App\Service\DetectionService;
  22. use App\Traits\CmsTrait;
  23. use App\Traits\PostTrait;
  24. use App\Traits\UserTrait;
  25. use Illuminate\Database\QueryException;
  26. use Illuminate\Support\Carbon;
  27. use Illuminate\Support\Facades\Log;
  28. use Illuminate\Support\Facades\Redis;
  29. use Illuminate\Support\Facades\DB;
  30. use Tymon\JWTAuth\Facades\JWTAuth;
  31. class PostRepositories
  32. {
  33. use UserTrait;
  34. use PostTrait;
  35. use CmsTrait;
  36. public function __construct(Post $post,
  37. PostData $postData,
  38. PostImgs $postImgs,
  39. PostComment $postComment,
  40. PostCollect $postCollect,
  41. PostShare $postShare,
  42. PostLog $postLog,
  43. DetectionService $detectionService,
  44. AliYunVodService $aliYunVodService,
  45. Topic $topic)
  46. {
  47. $this->post = $post;
  48. $this->postData = $postData;
  49. $this->postImgs = $postImgs;
  50. $this->postComment = $postComment;
  51. $this->postCollect = $postCollect;
  52. $this->postShare = $postShare;
  53. $this->postLog = $postLog;
  54. $this->detectionService = $detectionService;
  55. $this->topic = $topic;
  56. $this->aliYunVodService = $aliYunVodService;
  57. }
  58. /**
  59. * 发布内容
  60. */
  61. public function create($request)
  62. {
  63. //验证小号
  64. $userInfo = $this->getUserInfo();
  65. if (empty($userInfo)) {
  66. return jsonError('获取用户信息失败');
  67. }
  68. if(!$userInfo['sns_status']){
  69. return jsonError('您已被禁言');
  70. }
  71. $isValid = 0;
  72. if($userInfo['strength']){
  73. $isValid = 1;
  74. }
  75. // $oneHourTime = Carbon::now()->addHours(-1)->toDateTimeString();
  76. // $oneHourPostCount = $this->post->where('uid', $userInfo['uid'])->where('created_at', '>', $oneHourTime)->count();
  77. // if($oneHourPostCount > 5){
  78. // return jsonError('创作欲望太强啦,休息一下,看看其他用户的内容吧!');
  79. // }
  80. $detectionText = $request['title'] .','. $request['content'];
  81. $detectionTextResult = $this->detectionService->checkText($detectionText);
  82. if ($detectionTextResult['code']<0) {
  83. return jsonError('内容违规,请修正哦');
  84. }
  85. $topicIds = json_decode($request['topic_ids'], true);
  86. $topicCount = count($topicIds);
  87. if($topicCount == 0 || $topicCount > 5){
  88. return jsonError('所选话题必须1-5个');
  89. }
  90. //验证话题
  91. $hasTopicCount = $this->topic->whereIn('id', $topicIds)->count();
  92. if($topicCount != $hasTopicCount){
  93. Log::error('所选话题非法'.$request['topic_ids']);
  94. return jsonError('所选话题非法');
  95. }
  96. $imgs = [];
  97. if($request['type'] == 'image'){
  98. $imgs = json_decode($request['imgs'], true);
  99. $imgCount = count($imgs);
  100. if($imgCount == 0 || $imgCount > 9){
  101. return jsonError('所传图集必须1-9个');
  102. }
  103. }
  104. $allImg = array_merge($imgs, [$request['img']]);
  105. $detectionImageResult = $this->detectionService->checkImg($allImg);
  106. if ($detectionImageResult['code']<0) {
  107. return jsonError('图片违规,请修正哦');
  108. }
  109. $videoUrl = "";
  110. $videoId = "";
  111. if(isset($request['video']) && $request['video']){
  112. $videoId = $request['video'];
  113. for($i=0;$i<3;$i++){
  114. $videoUrl = $this->aliYunVodService->getPlayUrlByVideoId($request['video']);
  115. Log::debug('video-url:'.$videoUrl);
  116. if($videoUrl){
  117. break;
  118. }
  119. }
  120. if(empty($videoUrl)){
  121. return jsonError('发布失败,请重试');
  122. }
  123. }
  124. $data = [
  125. 'uid' => $userInfo['uid'],
  126. 'username' => $userInfo['username'],
  127. 'mobile' => $userInfo['mobile'],
  128. 'avatar' => $userInfo['avatar']??'',
  129. 'type' => $request['type'],
  130. 'img' => $request['img'],
  131. 'video' => $videoUrl,
  132. 'video_id' => $videoId,
  133. 'topic_ids' => implode(',', $topicIds),
  134. 'title' => isset($request['title'])? $request['title'] : '',
  135. 'content' => $request['content'],
  136. 'location' => isset($request['location'])? $request['location'] : '',
  137. 'is_suggest' => 0,
  138. 'is_hide' => 0
  139. ];
  140. $date = date('Y-m-d H:i:s');
  141. $fresh = (Carbon::now()->timestamp) - (Carbon::parse("2019-05-01 00:00:00")->timestamp);
  142. $score = $fresh / 86400;
  143. DB::beginTransaction();
  144. try{
  145. $post = $this->post->create($data);
  146. $postData = $this->postData->create([
  147. 'post_id' => $post->id,
  148. 'pv' => 0,
  149. 'pv_real' => 0,
  150. 'dislike_count' => 0,
  151. 'praise_count' => 0,
  152. 'praise_real_count' => 0,
  153. 'share_count' => 0,
  154. 'share_real_count' => 0,
  155. 'comment_count' => 0,
  156. 'collect_count' => 0,
  157. 'collect_real_count' => 0,
  158. 'available_bean' => $this->availableBean(),
  159. 'will_collect_bean' => rand(100, 200),
  160. 'collect_bean' => 0,
  161. 'weight' => $score
  162. ]);
  163. if($imgs){
  164. $imgData = [];
  165. foreach($imgs as $img){
  166. $imgData[] = [
  167. 'post_id' => $post->id,
  168. 'img' => $img,
  169. 'created_at' => $date,
  170. 'updated_at' => $date
  171. ];
  172. }
  173. $this->postImgs->insert($imgData);
  174. }
  175. DB::commit();
  176. Redis::zadd('post_trigger_type', $isValid, $post->id);
  177. foreach($topicIds as $id){
  178. Redis::zincrby('topic.user_uid'.$userInfo['uid'], 1, $id);
  179. }
  180. return jsonSuccess([
  181. 'post_id' => $post->id,
  182. 'h5url' => config('customer.share_post_h5url')."?post_id={$post->id}&invite_code={$userInfo['invite_code']}",
  183. 'bean' => $postData->available_bean,
  184. ]);
  185. }catch (QueryException $exception){
  186. DB::rollBack();
  187. Log::debug('发布内容失败:'.$exception->getMessage());
  188. return jsonError('发布内容失败,请重试');
  189. }
  190. }
  191. /**
  192. * 评论&回复
  193. */
  194. public function comment($request)
  195. {
  196. //验证小号
  197. $userInfo = $this->getUserInfo();
  198. if (empty($userInfo)) {
  199. return jsonError('获取用户信息失败');
  200. }
  201. if(!$userInfo['sns_status']){
  202. return jsonError('您已被禁言');
  203. }
  204. $oneHourTime = Carbon::now()->addHours(-1)->toDateTimeString();
  205. $oneHourCommentCount = $this->postComment->where('uid', $userInfo['uid'])->where('created_at', '>', $oneHourTime)->count();
  206. if($oneHourCommentCount > 59){
  207. return jsonError('回复了这么多,休息休息,喝口水吧!');
  208. }
  209. $detectionTextResult = $this->detectionService->checkText($request['content']);
  210. if ($detectionTextResult['code']<0) {
  211. return jsonError('内容违规,请修正哦');
  212. }
  213. $post = $this->post->find($request['post_id']);
  214. if(!$post){
  215. return jsonError('获取内容信息失败');
  216. }
  217. $data = [
  218. 'uid' => $userInfo['uid'],
  219. 'post_id' => $request['post_id'],
  220. 'parent_id' => 0,
  221. 'username' => $userInfo['username'],
  222. 'reply_uid' => 0,
  223. 'reply_username' => '',
  224. 'avatar' => $userInfo['avatar']??'',
  225. 'content' => $request['content'],
  226. 'is_delete' => 0,
  227. ];
  228. if(isset($request['parent_id']) && $request['parent_id'] != 0){
  229. $comment = $this->postComment->find($request['parent_id']);
  230. if(!$comment || $comment->post_id != $post->id){
  231. return jsonError('获取评论信息失败');
  232. }
  233. if($comment->parent_id){
  234. return jsonError('只能回复评论');
  235. }
  236. $data['parent_id'] = $request['parent_id'];
  237. if(isset($request['reply_uid']) && isset($request['reply_username'])){
  238. $data['reply_uid'] = $request['reply_uid'];
  239. $data['reply_username'] = $request['reply_username'];
  240. }else{
  241. $data['reply_uid'] = 0;
  242. $data['reply_username'] = '';
  243. }
  244. }
  245. DB::beginTransaction();
  246. try{
  247. $comment = $this->postComment->create($data);
  248. DB::commit();
  249. return jsonSuccess(['id' => $comment->id], '评论成功');
  250. }catch (QueryException $exception){
  251. DB::rollBack();
  252. Log::debug('评论内容失败:'.$exception->getMessage());
  253. return jsonError('评论内容失败,请重试');
  254. }
  255. }
  256. /**
  257. * 内容列表
  258. */
  259. public function lists($request)
  260. {
  261. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  262. return $this->post
  263. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  264. ->select('post.*')
  265. ->where(function($query) use ($request){
  266. if(isset($request['keyword'])){
  267. $query->where('title', 'like', "%{$request['keyword']}%")
  268. ->orWhere('content', 'like', "%{$request['keyword']}%");
  269. }
  270. })
  271. ->where(function($query) use ($request){
  272. if(isset($request['topic_ids']) && $request['topic_ids']){
  273. $topicIds = json_decode($request['topic_ids'], true);
  274. foreach ($topicIds as $key=>$id) {
  275. if ($key==0) {
  276. $query->whereRaw('FIND_IN_SET('.$id.', post.topic_ids)');
  277. } else {
  278. $query->orWhereRaw('FIND_IN_SET('.$id.', post.topic_ids)');
  279. }
  280. }
  281. }
  282. })
  283. ->orderBy('weight','desc')
  284. ->paginate($perPage);
  285. }
  286. /**
  287. * 视频列表
  288. */
  289. public function video($request)
  290. {
  291. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  292. $where = [];
  293. $id = 0;
  294. if(isset($request['id'])){
  295. $id = $request['id'];
  296. }
  297. $where[] = ['type', 'video'];
  298. if(isset($request['type'])){
  299. if($request['type'] == 'hot'){
  300. $ids = Redis::get('hotVideoIds');
  301. if(!$ids){
  302. $ids = $this->hotVideoIds();
  303. if(!$ids){
  304. $ids = '';
  305. }
  306. }
  307. Log::debug('热门视频ids'.$ids);
  308. return $this->post
  309. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  310. ->select('post.*', DB::raw("IF (post.id = {$id},1,0) as sort"))
  311. ->where($where)
  312. ->whereIn('post.id', explode(',', $ids))
  313. ->orderBy('sort', 'desc')
  314. ->orderByRaw(DB::raw("FIELD(post.id,{$ids})"))
  315. ->paginate($perPage);
  316. }elseif($request['type'] == 'one'){
  317. $where[] = ['post.id', $id];
  318. return $this->post
  319. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  320. ->select('post.*')
  321. ->where($where)
  322. ->paginate($perPage);
  323. }
  324. }
  325. return $this->post
  326. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  327. ->select('post.*', DB::raw("IF (post.id = {$id},1,0) as sort"))
  328. ->where($where)
  329. ->orderBy('sort', 'desc')
  330. ->orderBy('weight','desc')
  331. ->paginate($perPage);
  332. }
  333. /**
  334. * 个人中心内容列表
  335. */
  336. public function MyPost($request, $uid)
  337. {
  338. $type = $request['type'];
  339. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  340. $where = [];
  341. if($type == 'create'){
  342. $where[] = ['post.uid', $uid];
  343. $post = $this->post;
  344. $order = 'post.id';
  345. }elseif($type == 'collect'){
  346. $post = $this->post->join('post_collect', 'post_collect.post_id', '=', 'post.id');
  347. $where[] = ['post_collect.uid', $uid];
  348. $order = 'post_collect.id';
  349. }else{
  350. $post = $this->post->join('post_share', 'post_share.post_id', '=', 'post.id');
  351. $where[] = ['post_share.uid', $uid];
  352. $order = 'post_share.updated_at';
  353. }
  354. return $post
  355. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  356. ->select('post.*')
  357. ->where($where)
  358. ->orderBy($order,'desc')
  359. ->paginate($perPage);
  360. }
  361. /**
  362. * 内容详情
  363. */
  364. public function detail($id)
  365. {
  366. return $this->post
  367. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  368. ->select('post.*')
  369. ->find($id);
  370. }
  371. /**
  372. * 内容是否存在
  373. */
  374. public function detailExists($id)
  375. {
  376. return $this->post->where('id', $id)->exists();
  377. }
  378. /**
  379. * 推荐内容列表
  380. */
  381. public function suggestPost($request)
  382. {
  383. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  384. return $this->post
  385. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  386. ->select('post.*')
  387. ->orderBy('weight','desc')
  388. ->paginate($perPage);
  389. }
  390. /**
  391. * 话题内容
  392. */
  393. public function topicPost($request)
  394. {
  395. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  396. return $this->post
  397. ->join('post_data', 'post_data.post_id', '=', 'post.id')
  398. ->select('post.*')
  399. ->whereRaw('FIND_IN_SET(' . $request['id'] . ',post.topic_ids)')
  400. ->orderBy('id','desc')
  401. ->paginate($perPage);
  402. }
  403. /**
  404. * 评论列表
  405. */
  406. public function commentList($request)
  407. {
  408. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  409. return $this->postComment
  410. ->where('post_id', $request['post_id'])
  411. ->where('parent_id', 0)
  412. ->orderBy('id','desc')
  413. ->paginate($perPage);
  414. }
  415. /**
  416. * 回复列表
  417. */
  418. public function replyList($request)
  419. {
  420. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  421. return $this->postComment
  422. ->where('parent_id', $request['id'])
  423. ->orderBy('id','desc')
  424. ->paginate($perPage);
  425. }
  426. /**
  427. * 话题列表
  428. */
  429. public function topicList($request)
  430. {
  431. $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
  432. $where = [];
  433. if(isset($request['category_id']) && $request['category_id']){
  434. $topic = $this->topic->join('category_topic', 'category_topic.topic_id', '=', 'topic.id')->select('topic.*');
  435. $where[] = ['category_topic.category_id', $request['category_id']];
  436. }else{
  437. $topic = $this->topic;
  438. }
  439. if(isset($request['is_suggest']) && $request['is_suggest']){
  440. $where[] = ['topic.is_hot', $request['is_suggest']];
  441. }
  442. if(isset($request['name'])){
  443. $where[] = ['topic.name', 'like', "%{$request['name']}%"];
  444. }
  445. return $topic
  446. ->where($where)
  447. ->orderBy('id','desc')
  448. ->paginate($perPage);
  449. }
  450. /**
  451. * 更新帖子统计数量
  452. * @param $request
  453. * @return mixed
  454. */
  455. public function updatePostData($request)
  456. {
  457. $postId = isset($request['post_id'])?$request['post_id']:0;
  458. if(empty($postId)){
  459. Log::debug("非帖子类操作,不操作帖子统计数量".json_encode($request));
  460. return true;
  461. }
  462. $post = PostData::where('post_id', $postId)->first();
  463. if(!$post) return true;
  464. if (isset($request['behavior_flag']) && $request['behavior_flag'] == 'read') {
  465. $post->pv += 1;
  466. $post->pv_real += 1;
  467. Log::debug("帖子:".$postId."被阅读,pv +1");
  468. } elseif (isset($request['behavior_flag']) && $request['behavior_flag'] == 'unlike') {
  469. $post->dislike_count += 1;
  470. PostDislike::create(['uid'=>$request['target_id'],'post_id'=>$request['post_id']]);
  471. Log::debug("帖子:".$postId."被不喜欢,unlike +1");
  472. } elseif (isset($request['behavior_flag']) && $request['behavior_flag'] == 'like') {
  473. if($request['behavior_value']){
  474. $post->praise_count += 1;
  475. $post->praise_real_count += 1;
  476. PostLike::create(['uid'=>$request['target_id'],'post_id'=>$request['post_id']]);
  477. Log::debug("帖子:".$postId."被点赞,praise_count +1");
  478. }else{
  479. $post->praise_count -= 1;
  480. $post->praise_real_count -= 1;
  481. PostLike::where(['uid'=>$request['target_id'],'post_id'=>$request['post_id']])->delete();
  482. Log::debug("帖子:".$postId."被取消点赞,praise_count -1");
  483. }
  484. } elseif (isset($request['behavior_flag']) && $request['behavior_flag'] == 'forward') {
  485. $post->share_count += 1;
  486. $post->share_real_count += 1;
  487. $shareRow = PostShare::where(['uid'=>$request['target_id'],'post_id'=>$request['post_id']])->first();
  488. if($shareRow){
  489. PostShare::where(['uid'=>$request['target_id'],'post_id'=>$request['post_id']])->update(['uid'=>$request['target_id'],'post_id'=>$request['post_id']]);
  490. }else{
  491. PostShare::create(['uid'=>$request['target_id'],'post_id'=>$request['post_id']]);
  492. }
  493. Log::debug("帖子:".$postId."被分享,share_count +1");
  494. } elseif (isset($request['behavior_flag']) && $request['behavior_flag'] == 'comment') {
  495. $post->comment_count += 1;
  496. Log::debug("帖子:".$postId."被评论,comment_count +1");
  497. } elseif (isset($request['behavior_flag']) && $request['behavior_flag'] == 'collect') {
  498. if($request['behavior_value']) {
  499. $post->collect_count += 1;
  500. $post->collect_real_count += 1;
  501. PostCollect::create(['uid'=>$request['target_id'],'post_id'=>$request['post_id']]);
  502. Log::debug("帖子:".$postId."被收藏,collect_count +1");
  503. }else{
  504. $post->collect_count -= 1;
  505. $post->collect_real_count -= 1;
  506. PostCollect::where(['uid'=>$request['target_id'],'post_id'=>$request['post_id']])->delete();
  507. Log::debug("帖子:".$postId."被取消收藏,collect_count -1");
  508. }
  509. }
  510. $this->collectPostId($request['post_id']);
  511. return $post->save();
  512. }
  513. /**
  514. * 收集所有有操作的帖子,存入redis
  515. * 供后续计算帖子权重
  516. * @param $id
  517. */
  518. public function collectPostId($id)
  519. {
  520. $key = "community_calc_post_score";
  521. Redis::sadd($key,$id);
  522. Log::debug('存入帖子'.$id.'到权重列表');
  523. }
  524. /**
  525. * 话题详情
  526. */
  527. public function topicDetail($id)
  528. {
  529. return $this->topic
  530. ->find($id);
  531. }
  532. /**
  533. * 获取话题
  534. */
  535. public function getTopic($ids)
  536. {
  537. $topics = $this->topic
  538. ->whereIn('id', explode(',',$ids))
  539. ->orderByRaw(DB::raw("FIELD(id,{$ids})"))
  540. ->get();
  541. $data = [];
  542. foreach($topics as $topic){
  543. $data[] = [
  544. 'id' => $topic->id,
  545. 'name' => $topic->name,
  546. 'img' => $topic->img,
  547. 'follow_count' => getNumber($topic->follow->count() + config('customer.add_topic_follow_count')),
  548. ];
  549. }
  550. return $data;
  551. }
  552. /**
  553. * 获取内容视频组
  554. */
  555. public function getPostVideo($ids)
  556. {
  557. return $this->post
  558. ->select('id', 'img', 'uid', 'username', 'avatar')
  559. ->whereIn('id', explode(',',$ids))
  560. ->where('type', 'video')
  561. ->get();
  562. }
  563. //用户内容数,转发数,收藏数统计
  564. public function memberPostStatistics($uid){
  565. $postCount = $this->post->where('uid',$uid)->count();
  566. $postCollectCount = $this->postCollect->where('uid',$uid)->count();
  567. $postShareCount = $this->postShare->where('uid',$uid)->count();
  568. $data = ['post_count'=>$postCount,'share_count'=>$postShareCount,'collect_count'=>$postCollectCount];
  569. return jsonSuccess($data);
  570. }
  571. /**
  572. * 删除内容
  573. */
  574. public function delete($request)
  575. {
  576. //验证用户信息
  577. $userInfo = $this->getUserInfo();
  578. if (empty($userInfo)) {
  579. return jsonError('获取用户信息失败');
  580. }
  581. $post = $this->post->find($request['id']);
  582. if(!$post){
  583. return jsonError('获取内容信息失败');
  584. }
  585. if($post->uid != $userInfo['uid']){
  586. return jsonError('只能删除自己发布的内容');
  587. }
  588. $logData = [
  589. 'uid' => $userInfo['uid'],
  590. 'operator_type' => 'user',
  591. 'post_id' => $request['id'],
  592. 'username' => $userInfo['username'],
  593. 'log_type' => 'delete',
  594. 'content' => json_encode(['delete' => $request['id']]),
  595. ];
  596. DB::beginTransaction();
  597. try{
  598. $post->delete();
  599. $this->postLog->create($logData);
  600. DB::commit();
  601. Log::debug('删除内容失败:'.$request['id']);
  602. return jsonSuccess('删除内容成功');
  603. }catch (QueryException $exception){
  604. DB::rollBack();
  605. Log::debug('删除内容失败:'.$request['id'].$exception->getMessage());
  606. return jsonError('删除内容失败,请重试');
  607. }
  608. }
  609. }