Topicdongtai.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. use app\common\library\Keyworld;
  6. use think\Exception;
  7. /**
  8. * 圈子动态
  9. */
  10. class Topicdongtai extends Api
  11. {
  12. protected $noNeedLogin = [];
  13. protected $noNeedRight = ['*'];
  14. //发布动态
  15. public function addone(){
  16. $content = input('content','');
  17. $images = input('images','');
  18. $audio_file = input('audio_file','');
  19. $topic_ids = input('topic_ids','');
  20. $aite = input('aite','','htmlspecialchars_decode');
  21. $type = input('type',1);
  22. if(!$content && !$images){
  23. $this->error(__('Invalid parameters'));
  24. }
  25. //关键字替换
  26. $content = Keyworld::sensitive($content);
  27. //只保留一个
  28. if($type == 1){
  29. $audio_file = '';
  30. }else{
  31. $images = '';
  32. }
  33. $data = [
  34. 'topic_ids' => $topic_ids,
  35. 'user_id' => $this->auth->id,
  36. 'content' => $content,
  37. 'images' => $images,
  38. 'audio_file' => $audio_file,
  39. 'type' => $type,
  40. 'cityname' => input('cityname',''),
  41. 'aite' => $aite,
  42. 'is_public' => input('is_public',1),
  43. 'createtime' => time(),
  44. 'updatetime' => time(),
  45. ];
  46. Db::startTrans();
  47. $id = Db::name('topic_dongtai')->insertGetId($data);
  48. //圈子新增一个贴
  49. $rs = Db::name('topic_hub')->where('id','IN',$topic_ids)->setInc('t_number');
  50. Db::commit();
  51. $this->success('发布成功',$id);
  52. }
  53. //自己看列表
  54. //某用户的帖子列表
  55. public function my_lists(){
  56. $uid = input('uid',$this->auth->id);
  57. if (empty($uid)) {
  58. $uid = $this->auth->id;
  59. }
  60. $where = ['dt.user_id'=>$uid];
  61. if($uid != $this->auth->id){
  62. $where['dt.is_public'] = 1; //不是自己的,就只能看公开的
  63. }
  64. $list = Db::name('topic_dongtai')->alias('dt')
  65. ->join('user','dt.user_id = user.id','LEFT')
  66. ->join('user_wallet uw','user.id = uw.user_id','LEFT')
  67. ->field('dt.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,uw.vip_endtime')
  68. ->where($where)
  69. ->order('dt.id desc')->autopage()->select();
  70. $list = list_domain_image($list,['images','audio_file','avatar']);
  71. if(!empty($list)){
  72. foreach($list as $key => &$val){
  73. $val['aite'] = json_decode($val['aite'],true);
  74. //用户年龄
  75. $val['age'] = birthtime_to_age($val['birthday']);
  76. unset($val['birthday']);
  77. //用户vip
  78. $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
  79. unset($val['vip_endtime']);
  80. //追加点赞
  81. $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
  82. //时间
  83. $val['createtime_text'] = get_last_time($val['createtime']);
  84. //关注
  85. $val['is_follow'] = $this->is_follow($val['user_id'],$this->auth->id);
  86. //层主评论数量
  87. $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
  88. //话题
  89. $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->column('name');
  90. }
  91. }
  92. $this->success('success',$list);
  93. }
  94. //动态删除
  95. public function delete(){
  96. $id = input('id',0);
  97. $where['id'] = $id;
  98. $where['user_id'] = $this->auth->id;
  99. $dongtai = Db::name('topic_dongtai')->field('id,topic_ids')->where($where)->find();
  100. if (empty($dongtai)) {
  101. $this->error('未找到动态信息');
  102. }
  103. Db::startTrans();
  104. $delRes = Db::name('topic_dongtai')->where('id',$id)->where('user_id',$this->auth->id)->delete();
  105. if (!$delRes) {
  106. Db::rollback();
  107. $this->error('动态删除失败');
  108. }
  109. //话题少一个贴
  110. if (!empty($dongtai['topic_ids'])) {
  111. $res = Db::name('topic_hub')->where('id','IN',$dongtai['topic_ids'])->setDec('t_number');
  112. if (!$res) {
  113. Db::rollback();
  114. $this->error('更新话题数量失败');
  115. }
  116. }
  117. //删除对应的评论,
  118. Db::name('topic_dongtai_answer')->where('dt_id',$id)->delete();
  119. //点赞,
  120. Db::name('topic_dongtai_good')->where('dt_id',$id)->delete();
  121. //评论点赞
  122. Db::name('topic_answer_good')->where('dt_id',$id)->delete();
  123. Db::commit();
  124. $this->success('删除成功');
  125. }
  126. //某个圈子里的动态列表,关注,最新,附近
  127. public function topic_list(){
  128. $where = ['dt.is_public' => 1];
  129. //话题
  130. $topic_id = input('topic_id',0);
  131. $where_exp = [];
  132. if($topic_id){
  133. // $where['dt.topic_id'] = $topic_id;
  134. $where_exp[] = ['exp',Db::raw("FIND_IN_SET('".$topic_id."',dt.topic_ids)")];
  135. }
  136. //最新
  137. $order = input('orderby','new');
  138. $orderby = 'dt.id desc';
  139. //关注
  140. if($order == 'follow'){
  141. $follow_user_ids = Db::name('user_follow')->where(['uid'=>$this->auth->id])->column('follow_uid');
  142. $where['dt.user_id'] = ['IN',$follow_user_ids];
  143. }
  144. //附近,同城
  145. if($order == 'near'){
  146. $where['dt.cityname'] = $this->auth->cityname;
  147. }
  148. //性别
  149. $gender = input('gender','all');
  150. if($gender != 'all'){
  151. $where['user.gender'] = $gender;
  152. }
  153. //属性
  154. $attribute = input('attribute','all');
  155. if($attribute != 'all'){
  156. $where['user.attribute'] = $attribute;
  157. }
  158. //排除黑名单的
  159. $where2 = [];
  160. $black_ids = Db::name('user_black')->where(['uid'=>$this->auth->id])->column('black_uid');
  161. if(!empty($black_ids)){
  162. $where2['dt.user_id'] = ['NOTIN',$black_ids];
  163. }
  164. //列表
  165. $list = Db::name('topic_dongtai')->alias('dt')
  166. ->join('user','dt.user_id = user.id','LEFT')
  167. ->join('user_wallet uw','user.id = uw.user_id','LEFT')
  168. ->field('dt.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,uw.vip_endtime')
  169. ->where($where)
  170. ->where($where2)
  171. ->where($where_exp)
  172. ->order($orderby)->autopage()->select();
  173. $list = list_domain_image($list,['images','audio_file','avatar']);
  174. if(!empty($list)){
  175. foreach($list as $key => &$val){
  176. $val['aite'] = json_decode($val['aite'],true);
  177. //用户年龄
  178. $val['age'] = birthtime_to_age($val['birthday']);
  179. unset($val['birthday']);
  180. //用户vip
  181. $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
  182. unset($val['vip_endtime']);
  183. //追加点赞
  184. $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
  185. //时间
  186. $val['createtime_text'] = get_last_time($val['createtime']);
  187. //关注
  188. $val['is_follow'] = $this->is_follow($val['user_id'],$this->auth->id);
  189. //层主评论数量
  190. $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
  191. //话题
  192. $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->column('name');
  193. //艾特了谁
  194. $val['aite_user'] = Db::name('user')->where('id','IN',$val['aite'])->column('nickname');
  195. }
  196. }
  197. $this->success('success',$list);
  198. }
  199. //详情
  200. public function info(){
  201. $id = input('id');
  202. $info = Db::name('topic_dongtai')->alias('dt')
  203. ->join('user','dt.user_id = user.id','LEFT')
  204. ->join('user_wallet uw','user.id = uw.user_id','LEFT')
  205. ->field('dt.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,uw.vip_endtime')
  206. ->where('dt.id',$id)->find();
  207. $info = info_domain_image($info,['images','audio_file','avatar']);
  208. if($info){
  209. $info['aite'] = json_decode($info['aite'],true);
  210. //用户年龄
  211. $info['age'] = birthtime_to_age($info['birthday']);
  212. unset($info['birthday']);
  213. //用户vip
  214. $info['is_vip'] = $info['vip_endtime'] > time() ? 1 : 0;
  215. unset($info['vip_endtime']);
  216. //是否点赞过
  217. $info['isgood'] = $this->is_good($id,$this->auth->id);
  218. //时间
  219. $info['createtime_text'] = get_last_time($info['createtime']);
  220. //关注
  221. $info['is_follow'] = $this->is_follow($info['user_id'],$this->auth->id);
  222. //层主评论数量
  223. $info['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$id,'level'=>1])->count();
  224. //话题
  225. $info['topic_text'] = Db::name('topic_hub')->where('id','IN',$info['topic_ids'])->column('name');
  226. }
  227. $this->success('success',$info);
  228. }
  229. //点赞
  230. public function good(){
  231. $id = input('id');
  232. $where = [
  233. 'dt_id' => $id,
  234. 'user_id' => $this->auth->id,
  235. ];
  236. $check = Db::name('topic_dongtai_good')->where($where)->find();
  237. if($check){
  238. $this->error('已经赞过了');
  239. }
  240. Db::startTrans();
  241. $where['createtime'] = time();
  242. $rs = Db::name('topic_dongtai_good')->insertGetId($where);
  243. if(!$rs){
  244. Db::rollback();
  245. $this->error('点赞失败');
  246. }
  247. $up = Db::name('topic_dongtai')->where('id',$id)->setInc('goodnum');
  248. if($up === false){
  249. Db::rollback();
  250. $this->error('点赞失败');
  251. }
  252. // \app\common\model\TaskLog::tofinish($this->auth->id,"VpXtablCsZ",1);
  253. Db::commit();
  254. $this->success('点赞成功');
  255. }
  256. //评论
  257. public function answer(){
  258. $id = input('id',0);
  259. $content = input('content','');
  260. $to_user_id = input('to_user_id',0);
  261. $level = input('level',1); //回复类型:1=层主回复楼主,2=层中回复
  262. $floor = input('floor',0);
  263. if(empty($content) || empty($id)){
  264. $this->error();
  265. }
  266. //关键字替换
  267. $content = Keyworld::sensitive($content);
  268. //判断
  269. if($level == 2 && $floor == 0){
  270. $this->error('楼层错误');
  271. }
  272. //回复楼主,最新楼层
  273. if($level == 1 || $floor == 0){
  274. $to_user_id = 0;
  275. $floor = 1; //默认一楼
  276. $last_floor = Db::name('topic_dongtai_answer')->where(['dt_id'=>$id,'level'=>1])->order('floor desc')->value('floor');
  277. if($last_floor){
  278. $floor = $last_floor + 1;
  279. }
  280. }
  281. //判断user_id
  282. if($to_user_id){
  283. $to_user = Db::name('user')->where('id',$to_user_id)->value('id');
  284. if(empty($to_user)){
  285. $this->error('被回复的用户不存在');
  286. }
  287. }
  288. //data
  289. $data = [
  290. 'dt_id' => $id,
  291. 'floor' => $floor,
  292. 'user_id' => $this->auth->id,
  293. 'content' => $content,
  294. 'to_user_id' => $to_user_id,
  295. 'level' => $level,
  296. 'createtime' => time(),
  297. 'updatetime' => time(),
  298. ];
  299. Db::startTrans();
  300. $rs = Db::name('topic_dongtai_answer')->insertGetId($data);
  301. Db::name('topic_dongtai')->where('id',$id)->setInc('answernum');
  302. Db::commit();
  303. $this->success('评价成功');
  304. }
  305. //对评论点赞
  306. public function answer_good(){
  307. $dt_id = input('dt_id',0);
  308. $answer_id = input('answer_id',0);
  309. $where = [
  310. 'dt_id' => $dt_id,
  311. 'answer_id' => $answer_id,
  312. 'user_id' => $this->auth->id,
  313. ];
  314. $check = Db::name('topic_answer_good')->where($where)->find();
  315. if($check){
  316. $this->error('已经赞过了');
  317. }
  318. Db::startTrans();
  319. $where['createtime'] = time();
  320. $rs = Db::name('topic_answer_good')->insertGetId($where);
  321. $up = Db::name('topic_dongtai_answer')->where('id',$answer_id)->setInc('goodnum');
  322. if($rs && $up !== false){
  323. Db::commit();
  324. $this->success('点赞成功');
  325. }
  326. Db::rollback();
  327. $this->error('点赞失败');
  328. }
  329. //举报枚举
  330. /*public function report_enum(){
  331. $arr = [
  332. '侮辱谩骂',
  333. '色情低俗',
  334. '政治敏感',
  335. '违法违规',
  336. '其他',
  337. ];
  338. $this->success(1,$arr);
  339. }*/
  340. //举报
  341. /*public function report(){
  342. $field = ['dt_id','type','content','images'];
  343. $data = request_post_hub($field);
  344. $check = Db::name('topic_dongtai')->where('id',$data['dt_id'])->find();
  345. $data['user_id'] = $this->auth->id;
  346. $data['ruser_id'] = $check['user_id'];
  347. $data['createtime'] = time();
  348. Db::name('topic_dongtai_report')->insertGetId($data);
  349. $this->success('举报成功');
  350. }*/
  351. //收藏
  352. public function collect(){
  353. $where = [
  354. 'user_id' => $this->auth->id,
  355. 'table' => 'topic_dongtai',
  356. 'table_id' => input('id',0),
  357. ];
  358. $check = Db::name('user_collect')->where($where)->find();
  359. if($check){
  360. $this->success('已经收藏过了');
  361. }else{
  362. Db::name('user_collect')->insertGetId($where);
  363. $this->success('收藏成功');
  364. }
  365. }
  366. //不感兴趣,屏蔽某条
  367. /*public function screen(){
  368. $data = [
  369. 'user_id' => $this->auth->id,
  370. 'dt_id' => input('dt_id',0),
  371. ];
  372. $check = Db::name('topic_dongtai_screen')->where($data)->find();
  373. if($check){
  374. $this->success('操作成功');
  375. }
  376. Db::name('topic_dongtai_screen')->insertGetId($data);
  377. $this->success('操作成功');
  378. }*/
  379. //评论列表
  380. public function answer_list(){
  381. $dt_id = input('dt_id',0);
  382. //楼
  383. $floor_list = Db::name('topic_dongtai_answer')
  384. ->alias('a')
  385. ->field('a.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute')
  386. ->join('user','a.user_id = user.id','LEFT')
  387. ->where(['a.dt_id'=>$dt_id,'a.level'=>1])->order('a.id desc')->autopage()->select();
  388. $floor_list = list_domain_image($floor_list,['avatar']);
  389. //追加子评论
  390. if(!empty($floor_list)){
  391. foreach($floor_list as $key => &$val){
  392. //下面几条子回复,字符串
  393. $val['childremark'] = '';
  394. $map = [
  395. 'a.dt_id' => $dt_id,
  396. 'a.floor' => $val['floor'],
  397. 'a.level' => 2,
  398. ];
  399. $number = Db::name('topic_dongtai_answer')->alias('a')->where($map)->count();
  400. if($number > 0){
  401. $answer_info = Db::name('topic_dongtai_answer')
  402. ->alias('a')
  403. ->field('user.nickname')
  404. ->join('user','a.user_id = user.id','LEFT')
  405. ->where($map)->order('a.id desc')->find();
  406. $val['childremark'] = $answer_info['nickname'].'...等人,共'.$number.'条回复';
  407. }
  408. //时间处理
  409. $val['createtime_text'] = get_last_time($val['createtime']);
  410. //回复是否已赞
  411. $val['is_good'] = $this->answer_is_good($val['id'],$this->auth->id);
  412. //用户年龄
  413. $val['age'] = birthtime_to_age($val['birthday']);
  414. unset($val['birthday']);
  415. }
  416. }
  417. $this->success(1,$floor_list);
  418. }
  419. //单独某一层的详细
  420. public function answer_info(){
  421. $answer_id = input('answer_id');
  422. //楼
  423. $floor_info = Db::name('topic_dongtai_answer')
  424. ->alias('a')
  425. ->field('a.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute')
  426. ->join('user','a.user_id = user.id','LEFT')
  427. ->where(['a.id'=>$answer_id])->find();
  428. $floor_info = info_domain_image($floor_info,['avatar']);
  429. $floor_info['createtime_text'] = get_last_time($floor_info['createtime']);
  430. //用户年龄
  431. $floor_info['age'] = birthtime_to_age($floor_info['birthday']);
  432. unset($floor_info['birthday']);
  433. //回复是否已赞
  434. $floor_info['is_good'] = $this->answer_is_good($answer_id,$this->auth->id);
  435. $floor_info['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$floor_info['dt_id'],'floor'=>$floor_info['floor'],'level'=>2])->count();
  436. //层
  437. $floors = $floor_info['floor'];
  438. $child_lists = Db::name('topic_dongtai_answer')->alias('a')
  439. ->field('a.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute')
  440. ->join('user','a.user_id = user.id','LEFT')
  441. ->where(['a.dt_id'=>$floor_info['dt_id'],'a.floor'=>$floors,'a.level'=>2])->order('a.id desc')->autopage()->select();
  442. $child_lists = list_domain_image($child_lists,['avatar','to_avatar']);
  443. if(!empty($child_lists)){
  444. foreach($child_lists as $key => &$answer){
  445. //用户年龄
  446. $answer['age'] = birthtime_to_age($answer['birthday']);
  447. unset($answer['birthday']);
  448. $answer['is_good'] = $this->answer_is_good($answer['id'],$this->auth->id);
  449. $answer['createtime_text'] = get_last_time($answer['createtime']);
  450. }
  451. }
  452. //合并
  453. $floor_info['child'] = $child_lists;
  454. $this->success('success',$floor_info);
  455. }
  456. //是否点赞
  457. private function is_good($dt_id,$uid){
  458. $where = [
  459. 'dt_id' => $dt_id,
  460. 'user_id' => $uid,
  461. ];
  462. $check = Db::name('topic_dongtai_good')->where($where)->find();
  463. if($check){
  464. return 1;
  465. }else{
  466. return 0;
  467. }
  468. }
  469. //回复是否点赞
  470. private function answer_is_good($answer_id,$uid){
  471. $where = [
  472. 'answer_id' => $answer_id,
  473. 'user_id' => $uid,
  474. ];
  475. $check = Db::name('topic_answer_good')->where($where)->find();
  476. if($check){
  477. return 1;
  478. }else{
  479. return 0;
  480. }
  481. }
  482. //是否关注
  483. private function is_follow($uid,$follow_uid){
  484. $where = [
  485. 'uid' => $uid,
  486. 'follow_uid' => $follow_uid,
  487. ];
  488. $check = Db::name('user_follow')->where($where)->find();
  489. if($check){
  490. return 1;
  491. }else{
  492. return 0;
  493. }
  494. }
  495. //我的评论
  496. public function my_answer(){
  497. $map = [
  498. 'dt.user_id' => $this->auth->id,
  499. 'a.level' => 1,
  500. ];
  501. $list = Db::name('topic_dongtai_answer')->alias('a')
  502. ->field('a.id,a.createtime,a.content,
  503. dt.content as dt_content,dt.type as dt_type,dtuser.nickname as dtuser_nickname,
  504. user.nickname,user.avatar,user.gender,user.birthday,user.attribute,uw.vip_endtime')
  505. ->join('topic_dongtai dt','a.dt_id = dt.id','LEFT')
  506. ->join('user dtuser','dt.user_id = dtuser.id','LEFT')
  507. ->join('user','a.user_id = user.id','LEFT')
  508. ->join('user_wallet uw','user.id = uw.user_id','LEFT')
  509. ->where($map)->order('a.id desc')->autopage()->select();
  510. $list = list_domain_image($list,['avatar']);
  511. if(!empty($list)){
  512. foreach($list as $key => &$val){
  513. //用户年龄
  514. $val['age'] = birthtime_to_age($val['birthday']);
  515. unset($val['birthday']);
  516. //用户vip
  517. $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
  518. unset($val['vip_endtime']);
  519. }
  520. }
  521. $this->success(1,$list);
  522. }
  523. //删除我的某个评论
  524. public function delete_answer(){
  525. $id = input('id',0);
  526. Db::name('topic_dongtai_answer')->where('id',$id)->where('user_id',$this->auth->id)->delete();
  527. $this->success();
  528. }
  529. //我点赞的动态
  530. public function my_good(){
  531. $where = ['good.user_id'=>$this->auth->id];
  532. $list = Db::name('topic_dongtai')->alias('dt')
  533. ->join('user','dt.user_id = user.id','LEFT')
  534. ->join('user_wallet uw','user.id = uw.user_id','LEFT')
  535. ->join('topic_dongtai_good good','dt.id = good.dt_id','LEFT')
  536. ->field('dt.*,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,uw.vip_endtime')
  537. ->where($where)
  538. ->order('dt.id desc')->autopage()->select();
  539. $list = list_domain_image($list,['images','audio_file','avatar']);
  540. if(!empty($list)){
  541. foreach($list as $key => &$val){
  542. //用户年龄
  543. $val['age'] = birthtime_to_age($val['birthday']);
  544. unset($val['birthday']);
  545. //用户vip
  546. $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
  547. unset($val['vip_endtime']);
  548. //追加点赞
  549. $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
  550. //时间
  551. $val['createtime_text'] = get_last_time($val['createtime']);
  552. //关注
  553. $val['is_follow'] = $this->is_follow($val['user_id'],$this->auth->id);
  554. //层主评论数量
  555. $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
  556. //话题
  557. $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->column('name');
  558. }
  559. }
  560. $this->success('success',$list);
  561. }
  562. }