|  | @@ -17,47 +17,31 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      //发布动态
 |  |      //发布动态
 | 
											
												
													
														|  |      public function addone(){
 |  |      public function addone(){
 | 
											
												
													
														|  | 
 |  | +        $type = input('type',1);
 | 
											
												
													
														|  |          $content = input('content','');
 |  |          $content = input('content','');
 | 
											
												
													
														|  |          $images = input('images','');
 |  |          $images = input('images','');
 | 
											
												
													
														|  | -        $audio_file = input('audio_file','');
 |  | 
 | 
											
												
													
														|  | -        $topic_ids = input('topic_ids','');
 |  | 
 | 
											
												
													
														|  | -        $aite = input('aite','','htmlspecialchars_decode');
 |  | 
 | 
											
												
													
														|  | -        $type = input('type',1);
 |  | 
 | 
											
												
													
														|  | -        $audio_second = input('audio_second',0);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $video_file = input('video_file','');
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        if(!$content && !$images && !$audio_file){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if(!$content && !$images && !$video_file){
 | 
											
												
													
														|  |              $this->error(__('Invalid parameters'));
 |  |              $this->error(__('Invalid parameters'));
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        if(!$this->user_auth_limit()){
 |  | 
 | 
											
												
													
														|  | -            $this->error('请先完成实名认证');
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |          //关键字替换
 |  |          //关键字替换
 | 
											
												
													
														|  |          $content = Keyworld::sensitive($content);
 |  |          $content = Keyworld::sensitive($content);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          //只保留一个
 |  |          //只保留一个
 | 
											
												
													
														|  |          if($type == 1){
 |  |          if($type == 1){
 | 
											
												
													
														|  | -            $audio_file = '';
 |  | 
 | 
											
												
													
														|  | -            $audio_second = 0;
 |  | 
 | 
											
												
													
														|  | 
 |  | +            $video_file = '';
 | 
											
												
													
														|  |          }else{
 |  |          }else{
 | 
											
												
													
														|  |              $images = '';
 |  |              $images = '';
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $data = [
 |  |          $data = [
 | 
											
												
													
														|  | -            'topic_ids' => $topic_ids,
 |  | 
 | 
											
												
													
														|  |              'user_id' => $this->auth->id,
 |  |              'user_id' => $this->auth->id,
 | 
											
												
													
														|  | 
 |  | +            'type'  => $type,
 | 
											
												
													
														|  |              'content' => $content,
 |  |              'content' => $content,
 | 
											
												
													
														|  |              'images' => $images,
 |  |              'images' => $images,
 | 
											
												
													
														|  | -            'audio_file' => $audio_file,
 |  | 
 | 
											
												
													
														|  | -            'type'  => $type,
 |  | 
 | 
											
												
													
														|  | -            'cityname'  => input('cityname',''),
 |  | 
 | 
											
												
													
														|  | -            'provincename'  => input('provincename',''),
 |  | 
 | 
											
												
													
														|  | -            'aite'  => $aite,
 |  | 
 | 
											
												
													
														|  | -            'is_public'  => input('is_public',1),
 |  | 
 | 
											
												
													
														|  | -            'audio_second'  => $audio_second,
 |  | 
 | 
											
												
													
														|  | -            'longitude'  => input('longitude',0),
 |  | 
 | 
											
												
													
														|  | -            'latitude'  => input('latitude',0),
 |  | 
 | 
											
												
													
														|  | 
 |  | +            'video_file' => $video_file,
 | 
											
												
													
														|  |              'createtime' => time(),
 |  |              'createtime' => time(),
 | 
											
												
													
														|  |              'updatetime' => time(),
 |  |              'updatetime' => time(),
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -70,36 +54,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |              $data['auditstatus'] = 0;
 |  |              $data['auditstatus'] = 0;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        Db::startTrans();
 |  | 
 | 
											
												
													
														|  |          $id = Db::name('topic_dongtai')->insertGetId($data);
 |  |          $id = Db::name('topic_dongtai')->insertGetId($data);
 | 
											
												
													
														|  | -        //圈子新增一个贴
 |  | 
 | 
											
												
													
														|  | -        $rs = Db::name('topic_hub')->where('id','IN',$topic_ids)->setInc('t_number');
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        //task任务
 |  | 
 | 
											
												
													
														|  | -        //发第一条动态
 |  | 
 | 
											
												
													
														|  | -        $task_count = Db::name('topic_dongtai')->where('user_id',$this->auth->id)->count();
 |  | 
 | 
											
												
													
														|  | -        if($task_count == 1){
 |  | 
 | 
											
												
													
														|  | -            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,16);
 |  | 
 | 
											
												
													
														|  | -            if($task_rs === false){
 |  | 
 | 
											
												
													
														|  | -                Db::rollback();
 |  | 
 | 
											
												
													
														|  | -                $this->error('完成任务失败');
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        //通知艾特的人
 |  | 
 | 
											
												
													
														|  | -        if(!empty($aite)){
 |  | 
 | 
											
												
													
														|  | -            $aite = json_decode($aite,true);
 |  | 
 | 
											
												
													
														|  | -            if(!empty($aite) && is_array($aite)){
 |  | 
 | 
											
												
													
														|  | -                foreach($aite as $key => $uid){
 |  | 
 | 
											
												
													
														|  | -                    //系统消息
 |  | 
 | 
											
												
													
														|  | -                    if(is_array($uid) && isset($uid['id'])){
 |  | 
 | 
											
												
													
														|  | -                        $msg_id = \app\common\model\Message::addMessage($uid['id'],'动态通知',$this->auth->nickname.'发布动态并@了你,快去看看吧','dongtai_aite',$id);
 |  | 
 | 
											
												
													
														|  | -                    }
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        Db::commit();
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $this->success('发布成功',$id);
 |  |          $this->success('发布成功',$id);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
										
											
												
													
														|  | @@ -107,10 +62,6 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |      //自己看列表
 |  |      //自己看列表
 | 
											
												
													
														|  |      //某用户的帖子列表
 |  |      //某用户的帖子列表
 | 
											
												
													
														|  |      public function my_lists(){
 |  |      public function my_lists(){
 | 
											
												
													
														|  | -        $page = input('page',1);
 |  | 
 | 
											
												
													
														|  | -        if($page > 1){
 |  | 
 | 
											
												
													
														|  | -            $this->success('success',[]);
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $uid = input('uid',$this->auth->id);
 |  |          $uid = input('uid',$this->auth->id);
 | 
											
												
													
														|  |          if (empty($uid)) {
 |  |          if (empty($uid)) {
 | 
											
										
											
												
													
														|  | @@ -122,56 +73,26 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          ];
 |  |          ];
 | 
											
												
													
														|  |          if($uid != $this->auth->id){
 |  |          if($uid != $this->auth->id){
 | 
											
												
													
														|  | -            $where['dt.is_public'] = 1;  //不是自己的,就只能看公开的。公开:1=公开,2=私密
 |  | 
 | 
											
												
													
														|  |              $where['dt.auditstatus'] = 1;  //不是自己的,就只能看审核通过的
 |  |              $where['dt.auditstatus'] = 1;  //不是自己的,就只能看审核通过的
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $list = Db::name('topic_dongtai')->alias('dt')
 |  |          $list = Db::name('topic_dongtai')->alias('dt')
 | 
											
												
													
														|  |              ->join('user','dt.user_id = user.id','LEFT')
 |  |              ->join('user','dt.user_id = user.id','LEFT')
 | 
											
												
													
														|  | -            ->join('user_wallet uw','user.id = uw.user_id','LEFT')
 |  | 
 | 
											
												
													
														|  | -            ->field('dt.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 |  | 
 | 
											
												
													
														|  | 
 |  | +            ->field('dt.*,user.nickname,user.avatar')
 | 
											
												
													
														|  |              ->where($where)
 |  |              ->where($where)
 | 
											
												
													
														|  |              ->order('dt.id desc')->select();
 |  |              ->order('dt.id desc')->select();
 | 
											
												
													
														|  | -        $list = list_domain_image($list,['images','audio_file','avatar']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $list = list_domain_image($list,['images','video_file','avatar']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          if(!empty($list)){
 |  |          if(!empty($list)){
 | 
											
												
													
														|  |              foreach($list as $key => &$val){
 |  |              foreach($list as $key => &$val){
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                $val['aite'] = json_decode($val['aite'],true);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户年龄
 |  | 
 | 
											
												
													
														|  | -                $val['age'] = birthtime_to_age($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -                unset($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户vip
 |  | 
 | 
											
												
													
														|  | -                $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
 |  | 
 | 
											
												
													
														|  | -                unset($val['vip_endtime']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |                  //追加点赞
 |  |                  //追加点赞
 | 
											
												
													
														|  |                  $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
 |  |                  $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  //时间
 |  |                  //时间
 | 
											
												
													
														|  |                  $val['createtime_text'] = get_last_time($val['createtime']);
 |  |                  $val['createtime_text'] = get_last_time($val['createtime']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -                //关注
 |  | 
 | 
											
												
													
														|  | -                $val['is_follow'] = $this->is_follow($this->auth->id,$val['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //收藏
 |  | 
 | 
											
												
													
														|  | -                $val['is_collect'] = $this->is_collect($val['id'],$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //拉黑
 |  | 
 | 
											
												
													
														|  | -                $val['is_black'] = $this->is_black($this->auth->id,$val['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |                  //层主评论数量
 |  |                  //层主评论数量
 | 
											
												
													
														|  |                  $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 |  |                  $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //话题
 |  | 
 | 
											
												
													
														|  | -                $ids_str = $val['topic_ids'];
 |  | 
 | 
											
												
													
														|  | -                if($ids_str){
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->orderRaw('field(id,'.$ids_str.')')->column('name');
 |  | 
 | 
											
												
													
														|  | -                }else{
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = [];
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -184,7 +105,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          $id = input('id',0);
 |  |          $id = input('id',0);
 | 
											
												
													
														|  |          $where['id'] = $id;
 |  |          $where['id'] = $id;
 | 
											
												
													
														|  |          $where['user_id'] = $this->auth->id;
 |  |          $where['user_id'] = $this->auth->id;
 | 
											
												
													
														|  | -        $dongtai = Db::name('topic_dongtai')->field('id,topic_ids')->where($where)->find();
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $dongtai = Db::name('topic_dongtai')->field('id')->where($where)->find();
 | 
											
												
													
														|  |          if (empty($dongtai)) {
 |  |          if (empty($dongtai)) {
 | 
											
												
													
														|  |              $this->error('未找到动态信息');
 |  |              $this->error('未找到动态信息');
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -194,15 +115,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |              Db::rollback();
 |  |              Db::rollback();
 | 
											
												
													
														|  |              $this->error('动态删除失败');
 |  |              $this->error('动态删除失败');
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        //话题少一个贴
 |  | 
 | 
											
												
													
														|  | -        if (!empty($dongtai['topic_ids'])) {
 |  | 
 | 
											
												
													
														|  | -            $res = Db::name('topic_hub')->where('id','IN',$dongtai['topic_ids'])->setDec('t_number');
 |  | 
 | 
											
												
													
														|  | -            /*话题可能被删掉了,这里不判断了
 |  | 
 | 
											
												
													
														|  | -            if (!$res) {
 |  | 
 | 
											
												
													
														|  | -                Db::rollback();
 |  | 
 | 
											
												
													
														|  | -                $this->error('更新话题数量失败');
 |  | 
 | 
											
												
													
														|  | -            }*/
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          //删除对应的评论,
 |  |          //删除对应的评论,
 | 
											
												
													
														|  |          Db::name('topic_dongtai_answer')->where('dt_id',$id)->delete();
 |  |          Db::name('topic_dongtai_answer')->where('dt_id',$id)->delete();
 | 
											
												
													
														|  |          //点赞,
 |  |          //点赞,
 | 
											
										
											
												
													
														|  | @@ -215,168 +128,36 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |      //某个圈子里的动态列表,关注,最新,附近
 |  |      //某个圈子里的动态列表,关注,最新,附近
 | 
											
												
													
														|  |      public function topic_list(){
 |  |      public function topic_list(){
 | 
											
												
													
														|  |          $where = [
 |  |          $where = [
 | 
											
												
													
														|  | -            'dt.is_public' => 1,
 |  | 
 | 
											
												
													
														|  |              'dt.auditstatus' => 1,
 |  |              'dt.auditstatus' => 1,
 | 
											
												
													
														|  |          ];
 |  |          ];
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        //话题
 |  | 
 | 
											
												
													
														|  | -        $topic_id = input('topic_id',0);
 |  | 
 | 
											
												
													
														|  | -        $where_exp = [];
 |  | 
 | 
											
												
													
														|  | -        if($topic_id){
 |  | 
 | 
											
												
													
														|  | -            $where_exp[] = ['exp',Db::raw("FIND_IN_SET('".$topic_id."',dt.topic_ids)")];
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        //最新
 |  | 
 | 
											
												
													
														|  | -        $order = input('orderby','new');
 |  | 
 | 
											
												
													
														|  | -        $orderby  = 'dt.toptime desc,dt.id desc';
 |  | 
 | 
											
												
													
														|  | -        //关注
 |  | 
 | 
											
												
													
														|  | -        $where_follow = '';
 |  | 
 | 
											
												
													
														|  | -        if($order == 'follow'){
 |  | 
 | 
											
												
													
														|  | -            //关注的人
 |  | 
 | 
											
												
													
														|  | -            $follow_user_ids = Db::name('user_follow')->where(['uid'=>$this->auth->id])->column('follow_uid');
 |  | 
 | 
											
												
													
														|  | -            if(!empty($follow_user_ids)){
 |  | 
 | 
											
												
													
														|  | -                $where_follow .= '(dt.user_id IN ('.implode(',',$follow_user_ids).'))';
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            //关注的话题
 |  | 
 | 
											
												
													
														|  | -            $where_topic = "";
 |  | 
 | 
											
												
													
														|  | -            $follow_topic_ids= Db::name('user_follow_topic')->where(['uid'=>$this->auth->id])->column('topic_id');
 |  | 
 | 
											
												
													
														|  | -            if(!empty($follow_topic_ids)){
 |  | 
 | 
											
												
													
														|  | -                if(!empty($follow_user_ids)){
 |  | 
 | 
											
												
													
														|  | -                    $where_follow .= ' or ';
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                $where_topic .= "(";
 |  | 
 | 
											
												
													
														|  | -                foreach($follow_topic_ids as $ck => $cv){
 |  | 
 | 
											
												
													
														|  | -                    $where_topic .= "FIND_IN_SET('".$cv."',dt.topic_ids)";
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                    if($ck+1 < count($follow_topic_ids)){
 |  | 
 | 
											
												
													
														|  | -                        $where_topic .= " or ";
 |  | 
 | 
											
												
													
														|  | -                    }
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -                $where_topic .= ")";
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                $where_follow .= $where_topic;
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            //默认
 |  | 
 | 
											
												
													
														|  | -            if($where_follow == ''){
 |  | 
 | 
											
												
													
														|  | -                $where_follow = 'dt.id = 0';
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        //附近,根据距离排序
 |  | 
 | 
											
												
													
														|  | -        $having_dis = '';
 |  | 
 | 
											
												
													
														|  | -        if($order == 'near'){
 |  | 
 | 
											
												
													
														|  | -//            $where['dt.provincename'] = $this->auth->provincename;
 |  | 
 | 
											
												
													
														|  | -            $having_dis = 'distance < ' . 100000; //100公里范围
 |  | 
 | 
											
												
													
														|  | -            $orderby  = 'dt.toptime desc,distance asc';
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        //性别
 |  | 
 | 
											
												
													
														|  | -        $gender = input('gender','all');
 |  | 
 | 
											
												
													
														|  | -        if($gender != 'all'){
 |  | 
 | 
											
												
													
														|  | -            $where['user.gender'] = $gender;
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        //属性
 |  | 
 | 
											
												
													
														|  | -        $attribute = input('attribute','all');
 |  | 
 | 
											
												
													
														|  | -        if($attribute != 'all'){
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            if($attribute == 'EE'){
 |  | 
 | 
											
												
													
														|  | -                $where['user.attribute'] = ['IN',['EE','BOTH']];
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            if($attribute == 'ER'){
 |  | 
 | 
											
												
													
														|  | -                $where['user.attribute'] = ['IN',['ER','BOTH']];
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            if($attribute == 'BOTH'){
 |  | 
 | 
											
												
													
														|  | -                //$where['user.attribute'] = 'BOTH';
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        //排除黑名单的
 |  | 
 | 
											
												
													
														|  | -        $where_black = [];
 |  | 
 | 
											
												
													
														|  | -        $black_ids = Db::name('user_black')->where(['uid'=>$this->auth->id])->column('black_uid');
 |  | 
 | 
											
												
													
														|  | -        if(!empty($black_ids)){
 |  | 
 | 
											
												
													
														|  | -            $where_black['dt.user_id'] = ['NOTIN',$black_ids];
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $orderby  = 'dt.id desc';
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          //列表
 |  |          //列表
 | 
											
												
													
														|  | -        $field = 'dt.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime';
 |  | 
 | 
											
												
													
														|  | -        if($order == 'near'){
 |  | 
 | 
											
												
													
														|  | -            $field .= ',(st_distance(point (' . $this->auth->longitude . ', ' . $this->auth->latitude . '),point(dt.longitude,dt.latitude))*111195) as distance';
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $field = 'dt.*,user.nickname,user.avatar';
 | 
											
												
													
														|  | 
 |  | +       
 | 
											
												
													
														|  |          $list = Db::name('topic_dongtai')->alias('dt')
 |  |          $list = Db::name('topic_dongtai')->alias('dt')
 | 
											
												
													
														|  |              ->join('user','dt.user_id = user.id','LEFT')
 |  |              ->join('user','dt.user_id = user.id','LEFT')
 | 
											
												
													
														|  | -            ->join('user_wallet uw','user.id = uw.user_id','LEFT')
 |  | 
 | 
											
												
													
														|  |              ->field($field)
 |  |              ->field($field)
 | 
											
												
													
														|  |              ->where($where)
 |  |              ->where($where)
 | 
											
												
													
														|  | -            ->where($where_exp)
 |  | 
 | 
											
												
													
														|  | -            ->where($where_follow)
 |  | 
 | 
											
												
													
														|  | -            ->where($where_black);
 |  | 
 | 
											
												
													
														|  | -        if($order == 'near'){
 |  | 
 | 
											
												
													
														|  | -            $list = $list->having($having_dis);
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        $list = $list->order($orderby)
 |  | 
 | 
											
												
													
														|  | 
 |  | +            ->order($orderby)
 | 
											
												
													
														|  |              ->autopage()->select();
 |  |              ->autopage()->select();
 | 
											
												
													
														|  | -        $list = list_domain_image($list,['images','audio_file','avatar']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $list = list_domain_image($list,['images','video_file','avatar']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          if(!empty($list)){
 |  |          if(!empty($list)){
 | 
											
												
													
														|  |              foreach($list as $key => &$val){
 |  |              foreach($list as $key => &$val){
 | 
											
												
													
														|  | -                //艾特
 |  | 
 | 
											
												
													
														|  | -                $val['aite'] = json_decode($val['aite'],true);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //距离
 |  | 
 | 
											
												
													
														|  | -                $val['distance'] = isset($val['distance']) ? $val['distance'] : 0;
 |  | 
 | 
											
												
													
														|  | -                $val['distance'] = bcdiv(intval($val['distance']),1000,1).'km';
 |  | 
 | 
											
												
													
														|  | -                if($this->auth->longitude == 0 || $val['longitude'] == 0){
 |  | 
 | 
											
												
													
														|  | -                    $val['distance'] = '未知';
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -                //vip如果开了隐私保护,需要隐藏距离
 |  | 
 | 
											
												
													
														|  | -                $yinsi = $this->user_power($val['user_id'],'yinsi');
 |  | 
 | 
											
												
													
														|  | -                if($yinsi == 1){
 |  | 
 | 
											
												
													
														|  | -                    $val['distance'] = '';
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户年龄
 |  | 
 | 
											
												
													
														|  | -                $val['age'] = birthtime_to_age($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -                unset($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户vip
 |  | 
 | 
											
												
													
														|  | -                $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
 |  | 
 | 
											
												
													
														|  | -                unset($val['vip_endtime']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |                  //追加点赞
 |  |                  //追加点赞
 | 
											
												
													
														|  |                  $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
 |  |                  $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  //时间
 |  |                  //时间
 | 
											
												
													
														|  |                  $val['createtime_text'] = get_last_time($val['createtime']);
 |  |                  $val['createtime_text'] = get_last_time($val['createtime']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -                //关注
 |  | 
 | 
											
												
													
														|  | -                $val['is_follow'] = $this->is_follow($this->auth->id,$val['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //收藏
 |  | 
 | 
											
												
													
														|  | -                $val['is_collect'] = $this->is_collect($val['id'],$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //拉黑
 |  | 
 | 
											
												
													
														|  | -                $val['is_black'] = $this->is_black($this->auth->id,$val['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |                  //层主评论数量
 |  |                  //层主评论数量
 | 
											
												
													
														|  |                  $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 |  |                  $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -                //话题
 |  | 
 | 
											
												
													
														|  | -                $ids_str = $val['topic_ids'];
 |  | 
 | 
											
												
													
														|  | -                if($ids_str){
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->orderRaw('field(id,'.$ids_str.')')->column('name');
 |  | 
 | 
											
												
													
														|  | -                }else{
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = [];
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -                //艾特了谁
 |  | 
 | 
											
												
													
														|  | -//                $val['aite_user'] = Db::name('user')->where('id','IN',$val['aite'])->column('nickname');
 |  | 
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -388,49 +169,22 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $info = Db::name('topic_dongtai')->alias('dt')
 |  |          $info = Db::name('topic_dongtai')->alias('dt')
 | 
											
												
													
														|  |              ->join('user','dt.user_id = user.id','LEFT')
 |  |              ->join('user','dt.user_id = user.id','LEFT')
 | 
											
												
													
														|  | -            ->join('user_wallet uw','user.id = uw.user_id','LEFT')
 |  | 
 | 
											
												
													
														|  | -            ->field('dt.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            ->field('dt.*,user.nickname,user.avatar')
 | 
											
												
													
														|  |              ->where('dt.id',$id)->find();
 |  |              ->where('dt.id',$id)->find();
 | 
											
												
													
														|  | -        $info = info_domain_image($info,['images','audio_file','avatar']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $info = info_domain_image($info,['images','video_file','avatar']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          if($info){
 |  |          if($info){
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            $info['aite'] = json_decode($info['aite'],true);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            //用户年龄
 |  | 
 | 
											
												
													
														|  | -            $info['age'] = birthtime_to_age($info['birthday']);
 |  | 
 | 
											
												
													
														|  | -            unset($info['birthday']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            //用户vip
 |  | 
 | 
											
												
													
														|  | -            $info['is_vip'] = $info['vip_endtime'] > time() ? 1 : 0;
 |  | 
 | 
											
												
													
														|  | -            unset($info['vip_endtime']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |              //是否点赞过
 |  |              //是否点赞过
 | 
											
												
													
														|  |              $info['isgood'] = $this->is_good($id,$this->auth->id);
 |  |              $info['isgood'] = $this->is_good($id,$this->auth->id);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |              //时间
 |  |              //时间
 | 
											
												
													
														|  |              $info['createtime_text'] = get_last_time($info['createtime']);
 |  |              $info['createtime_text'] = get_last_time($info['createtime']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -            //关注
 |  | 
 | 
											
												
													
														|  | -            $info['is_follow'] = $this->is_follow($this->auth->id,$info['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            //收藏
 |  | 
 | 
											
												
													
														|  | -            $info['is_collect'] = $this->is_collect($id,$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            //拉黑
 |  | 
 | 
											
												
													
														|  | -            $info['is_black'] = $this->is_black($this->auth->id,$info['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |              //层主评论数量
 |  |              //层主评论数量
 | 
											
												
													
														|  |              $info['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$id,'level'=>1])->count();
 |  |              $info['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$id,'level'=>1])->count();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -            //话题
 |  | 
 | 
											
												
													
														|  | -            $ids_str = $info['topic_ids'];
 |  | 
 | 
											
												
													
														|  | -            if($ids_str){
 |  | 
 | 
											
												
													
														|  | -                $info['topic_text'] = Db::name('topic_hub')->where('id','IN',$ids_str)->orderRaw('field(id,'.$ids_str.')')->column('name');
 |  | 
 | 
											
												
													
														|  | -            }else{
 |  | 
 | 
											
												
													
														|  | -                $info['topic_text'] = [];
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  |          }else{
 |  |          }else{
 | 
											
												
													
														|  |              $this->error('此动态已被删除');
 |  |              $this->error('此动态已被删除');
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -481,9 +235,9 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      //评论
 |  |      //评论
 | 
											
												
													
														|  |      public function answer(){
 |  |      public function answer(){
 | 
											
												
													
														|  | -        if($this->apiLimit(1,5000) == false){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        /*if($this->apiLimit(1,5000) == false){
 | 
											
												
													
														|  |              $this->error('抱歉,您在5秒内只能进行一次回复');
 |  |              $this->error('抱歉,您在5秒内只能进行一次回复');
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        }*/
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $id = input('id',0);
 |  |          $id = input('id',0);
 | 
											
												
													
														|  |          $content = input('content','');
 |  |          $content = input('content','');
 | 
											
										
											
												
													
														|  | @@ -500,22 +254,6 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |              $this->error('楼层错误');
 |  |              $this->error('楼层错误');
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        //黑名单判断
 |  | 
 | 
											
												
													
														|  | -        //是否被动态发布者拉黑
 |  | 
 | 
											
												
													
														|  | -        $dongtai_user_id = Db::name('topic_dongtai')->where('id',$id)->value('user_id');
 |  | 
 | 
											
												
													
														|  | -        $black_check = $this->is_black($dongtai_user_id,$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -        if($black_check){
 |  | 
 | 
											
												
													
														|  | -            $this->error('您已被对方拉黑,禁止评论此动态');
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        //是否被层主拉黑
 |  | 
 | 
											
												
													
														|  | -        if($level == 2){
 |  | 
 | 
											
												
													
														|  | -            $answer_info = Db::name('topic_dongtai_answer')->where(['dt_id'=>$id,'level'=>1,'floor'=>$floor])->find();
 |  | 
 | 
											
												
													
														|  | -            $black_check = $this->is_black($answer_info['user_id'],$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -            if($black_check){
 |  | 
 | 
											
												
													
														|  | -                $this->error('您已被对方拉黑,禁止点评此评论');
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |          //关键字替换
 |  |          //关键字替换
 | 
											
												
													
														|  |          $content = Keyworld::sensitive($content);
 |  |          $content = Keyworld::sensitive($content);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -608,136 +346,13 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    //举报枚举
 |  | 
 | 
											
												
													
														|  | -    /*public function report_enum(){
 |  | 
 | 
											
												
													
														|  | -        $arr = [
 |  | 
 | 
											
												
													
														|  | -            '侮辱谩骂',
 |  | 
 | 
											
												
													
														|  | -            '色情低俗',
 |  | 
 | 
											
												
													
														|  | -            '政治敏感',
 |  | 
 | 
											
												
													
														|  | -            '违法违规',
 |  | 
 | 
											
												
													
														|  | -            '其他',
 |  | 
 | 
											
												
													
														|  | -        ];
 |  | 
 | 
											
												
													
														|  | -        $this->success(1,$arr);
 |  | 
 | 
											
												
													
														|  | -    }*/
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    //举报
 |  | 
 | 
											
												
													
														|  | -    public function report(){
 |  | 
 | 
											
												
													
														|  | -        $dt_id = input('dt_id',0);
 |  | 
 | 
											
												
													
														|  | -        $data['dt_id'] = $dt_id;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $check = Db::name('topic_dongtai')->where('id',$data['dt_id'])->find();
 |  | 
 | 
											
												
													
														|  | -        if(empty($check)){
 |  | 
 | 
											
												
													
														|  | -            $this->error('不存在的动态');
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $data['user_id']    = $this->auth->id;
 |  | 
 | 
											
												
													
														|  | -        $data['to_user_id'] = $check['user_id'];
 |  | 
 | 
											
												
													
														|  | -        $data['createtime'] = time();
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        Db::name('topic_dongtai_report')->insertGetId($data);
 |  | 
 | 
											
												
													
														|  | -        $this->success('举报成功');
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    //收藏,取消收藏
 |  | 
 | 
											
												
													
														|  | -    public function collect(){
 |  | 
 | 
											
												
													
														|  | -        $where = [
 |  | 
 | 
											
												
													
														|  | -            'user_id'  => $this->auth->id,
 |  | 
 | 
											
												
													
														|  | -            'table'    => 'topic_dongtai',
 |  | 
 | 
											
												
													
														|  | -            'table_id' => input('id',0),
 |  | 
 | 
											
												
													
														|  | -        ];
 |  | 
 | 
											
												
													
														|  | -        $check = Db::name('user_collect')->where($where)->find();
 |  | 
 | 
											
												
													
														|  | -        if($check){
 |  | 
 | 
											
												
													
														|  | -            Db::name('user_collect')->where($where)->delete();
 |  | 
 | 
											
												
													
														|  | -            $this->success('已取消收藏');
 |  | 
 | 
											
												
													
														|  | -        }else{
 |  | 
 | 
											
												
													
														|  | -            Db::name('user_collect')->insertGetId($where);
 |  | 
 | 
											
												
													
														|  | -            $this->success('收藏成功');
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    //我的收藏
 |  | 
 | 
											
												
													
														|  | -    public function my_collect(){
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $collect_id = Db::name('user_collect')->where(['table'=>'topic_dongtai','user_id'=>$this->auth->id])->column('table_id');
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $where = ['dt.id'=>['IN',$collect_id]];
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $list = Db::name('topic_dongtai')->alias('dt')
 |  | 
 | 
											
												
													
														|  | -            ->join('user','dt.user_id = user.id','LEFT')
 |  | 
 | 
											
												
													
														|  | -            ->join('user_wallet uw','user.id = uw.user_id','LEFT')
 |  | 
 | 
											
												
													
														|  | -            ->field('dt.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 |  | 
 | 
											
												
													
														|  | -            ->where($where)
 |  | 
 | 
											
												
													
														|  | -            ->order('dt.id desc')->autopage()->select();
 |  | 
 | 
											
												
													
														|  | -        $list = list_domain_image($list,['images','audio_file','avatar']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        if(!empty($list)){
 |  | 
 | 
											
												
													
														|  | -            foreach($list as $key => &$val){
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                $val['aite'] = json_decode($val['aite'],true);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户年龄
 |  | 
 | 
											
												
													
														|  | -                $val['age'] = birthtime_to_age($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -                unset($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户vip
 |  | 
 | 
											
												
													
														|  | -                $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
 |  | 
 | 
											
												
													
														|  | -                unset($val['vip_endtime']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //追加点赞
 |  | 
 | 
											
												
													
														|  | -                $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //时间
 |  | 
 | 
											
												
													
														|  | -                $val['createtime_text'] = get_last_time($val['createtime']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //关注
 |  | 
 | 
											
												
													
														|  | -                $val['is_follow'] = $this->is_follow($this->auth->id,$val['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //收藏
 |  | 
 | 
											
												
													
														|  | -                $val['is_collect'] = $this->is_collect($val['id'],$this->auth->id);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //拉黑
 |  | 
 | 
											
												
													
														|  | -                $val['is_black'] = $this->is_black($this->auth->id,$val['user_id']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //层主评论数量
 |  | 
 | 
											
												
													
														|  | -                $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //话题
 |  | 
 | 
											
												
													
														|  | -                $ids_str = $val['topic_ids'];
 |  | 
 | 
											
												
													
														|  | -                if($ids_str){
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->orderRaw('field(id,'.$ids_str.')')->column('name');
 |  | 
 | 
											
												
													
														|  | -                }else{
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = [];
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $this->success('success',$list);
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    //不感兴趣,屏蔽某条
 |  | 
 | 
											
												
													
														|  | -    /*public function screen(){
 |  | 
 | 
											
												
													
														|  | -        $data = [
 |  | 
 | 
											
												
													
														|  | -            'user_id' => $this->auth->id,
 |  | 
 | 
											
												
													
														|  | -            'dt_id'   => input('dt_id',0),
 |  | 
 | 
											
												
													
														|  | -        ];
 |  | 
 | 
											
												
													
														|  | -        $check = Db::name('topic_dongtai_screen')->where($data)->find();
 |  | 
 | 
											
												
													
														|  | -        if($check){
 |  | 
 | 
											
												
													
														|  | -            $this->success('操作成功');
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        Db::name('topic_dongtai_screen')->insertGetId($data);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        $this->success('操作成功');
 |  | 
 | 
											
												
													
														|  | -    }*/
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |      //评论列表
 |  |      //评论列表
 | 
											
												
													
														|  |      public function answer_list(){
 |  |      public function answer_list(){
 | 
											
												
													
														|  |          $dt_id = input('dt_id',0);
 |  |          $dt_id = input('dt_id',0);
 | 
											
												
													
														|  |          //楼
 |  |          //楼
 | 
											
												
													
														|  |          $floor_list = Db::name('topic_dongtai_answer')
 |  |          $floor_list = Db::name('topic_dongtai_answer')
 | 
											
												
													
														|  |              ->alias('a')
 |  |              ->alias('a')
 | 
											
												
													
														|  | -            ->field('a.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status')
 |  | 
 | 
											
												
													
														|  | 
 |  | +            ->field('a.*,user.nickname,user.avatar')
 | 
											
												
													
														|  |              ->join('user','a.user_id = user.id','LEFT')
 |  |              ->join('user','a.user_id = user.id','LEFT')
 | 
											
												
													
														|  |              ->where(['a.dt_id'=>$dt_id,'a.level'=>1])->order('a.id desc')->autopage()->select();
 |  |              ->where(['a.dt_id'=>$dt_id,'a.level'=>1])->order('a.id desc')->autopage()->select();
 | 
											
												
													
														|  |          $floor_list = list_domain_image($floor_list,['avatar']);
 |  |          $floor_list = list_domain_image($floor_list,['avatar']);
 | 
											
										
											
												
													
														|  | @@ -770,9 +385,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |                  //回复是否已赞
 |  |                  //回复是否已赞
 | 
											
												
													
														|  |                  $val['is_good'] = $this->answer_is_good($val['id'],$this->auth->id);
 |  |                  $val['is_good'] = $this->answer_is_good($val['id'],$this->auth->id);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -                //用户年龄
 |  | 
 | 
											
												
													
														|  | -                $val['age'] = birthtime_to_age($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -                unset($val['birthday']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -786,7 +399,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          //楼
 |  |          //楼
 | 
											
												
													
														|  |          $floor_info = Db::name('topic_dongtai_answer')
 |  |          $floor_info = Db::name('topic_dongtai_answer')
 | 
											
												
													
														|  |              ->alias('a')
 |  |              ->alias('a')
 | 
											
												
													
														|  | -            ->field('a.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status')
 |  | 
 | 
											
												
													
														|  | 
 |  | +            ->field('a.*,user.username,user.nickname,user.avatar')
 | 
											
												
													
														|  |              ->join('user','a.user_id = user.id','LEFT')
 |  |              ->join('user','a.user_id = user.id','LEFT')
 | 
											
												
													
														|  |              ->where(['a.id'=>$answer_id])->find();
 |  |              ->where(['a.id'=>$answer_id])->find();
 | 
											
												
													
														|  |          if(empty($floor_info)){
 |  |          if(empty($floor_info)){
 | 
											
										
											
												
													
														|  | @@ -794,9 +407,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          $floor_info = info_domain_image($floor_info,['avatar']);
 |  |          $floor_info = info_domain_image($floor_info,['avatar']);
 | 
											
												
													
														|  |          $floor_info['createtime_text'] = get_last_time($floor_info['createtime']);
 |  |          $floor_info['createtime_text'] = get_last_time($floor_info['createtime']);
 | 
											
												
													
														|  | -        //用户年龄
 |  | 
 | 
											
												
													
														|  | -        $floor_info['age'] = birthtime_to_age($floor_info['birthday']);
 |  | 
 | 
											
												
													
														|  | -        unset($floor_info['birthday']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          //回复是否已赞
 |  |          //回复是否已赞
 | 
											
												
													
														|  |          $floor_info['is_good'] = $this->answer_is_good($answer_id,$this->auth->id);
 |  |          $floor_info['is_good'] = $this->answer_is_good($answer_id,$this->auth->id);
 | 
											
												
													
														|  |          $floor_info['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$floor_info['dt_id'],'floor'=>$floor_info['floor'],'level'=>2])->count();
 |  |          $floor_info['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$floor_info['dt_id'],'floor'=>$floor_info['floor'],'level'=>2])->count();
 | 
											
										
											
												
													
														|  | @@ -804,16 +415,13 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          //层
 |  |          //层
 | 
											
												
													
														|  |          $floors = $floor_info['floor'];
 |  |          $floors = $floor_info['floor'];
 | 
											
												
													
														|  |          $child_lists = Db::name('topic_dongtai_answer')->alias('a')
 |  |          $child_lists = Db::name('topic_dongtai_answer')->alias('a')
 | 
											
												
													
														|  | -            ->field('a.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,tu.nickname as to_user_nickname')
 |  | 
 | 
											
												
													
														|  | 
 |  | +            ->field('a.*,user.username,user.nickname,user.avatar,tu.nickname as to_user_nickname')
 | 
											
												
													
														|  |              ->join('user','a.user_id = user.id','LEFT')
 |  |              ->join('user','a.user_id = user.id','LEFT')
 | 
											
												
													
														|  |              ->join('user tu','a.to_user_id = tu.id','LEFT')
 |  |              ->join('user tu','a.to_user_id = tu.id','LEFT')
 | 
											
												
													
														|  |              ->where(['a.dt_id'=>$floor_info['dt_id'],'a.floor'=>$floors,'a.level'=>2])->order('a.id desc')->autopage()->select();
 |  |              ->where(['a.dt_id'=>$floor_info['dt_id'],'a.floor'=>$floors,'a.level'=>2])->order('a.id desc')->autopage()->select();
 | 
											
												
													
														|  |          $child_lists = list_domain_image($child_lists,['avatar','to_avatar']);
 |  |          $child_lists = list_domain_image($child_lists,['avatar','to_avatar']);
 | 
											
												
													
														|  |          if(!empty($child_lists)){
 |  |          if(!empty($child_lists)){
 | 
											
												
													
														|  |              foreach($child_lists as $key => &$answer){
 |  |              foreach($child_lists as $key => &$answer){
 | 
											
												
													
														|  | -                //用户年龄
 |  | 
 | 
											
												
													
														|  | -                $answer['age'] = birthtime_to_age($answer['birthday']);
 |  | 
 | 
											
												
													
														|  | -                unset($answer['birthday']);
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  $answer['is_good'] = $this->answer_is_good($answer['id'],$this->auth->id);
 |  |                  $answer['is_good'] = $this->answer_is_good($answer['id'],$this->auth->id);
 | 
											
												
													
														|  |                  $answer['createtime_text'] = get_last_time($answer['createtime']);
 |  |                  $answer['createtime_text'] = get_last_time($answer['createtime']);
 | 
											
										
											
												
													
														|  | @@ -871,7 +479,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      //用户是否拉黑
 |  |      //用户是否拉黑
 | 
											
												
													
														|  | -    private function is_black($uid,$black_uid){
 |  | 
 | 
											
												
													
														|  | 
 |  | +    protected function is_black($uid,$black_uid){
 | 
											
												
													
														|  |          $where = [
 |  |          $where = [
 | 
											
												
													
														|  |              'uid'       => $uid,
 |  |              'uid'       => $uid,
 | 
											
												
													
														|  |              'black_uid' => $black_uid,
 |  |              'black_uid' => $black_uid,
 | 
											
										
											
												
													
														|  | @@ -893,27 +501,13 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          ];
 |  |          ];
 | 
											
												
													
														|  |          $list = Db::name('topic_dongtai_answer')->alias('a')
 |  |          $list = Db::name('topic_dongtai_answer')->alias('a')
 | 
											
												
													
														|  |              ->field('a.id,a.createtime,a.content,a.dt_id,
 |  |              ->field('a.id,a.createtime,a.content,a.dt_id,
 | 
											
												
													
														|  | -            dt.images,dt.content as dt_content,dt.type as dt_type,dtuser.nickname as dtuser_nickname,dtuser.username as dtuser_username,user.username,
 |  | 
 | 
											
												
													
														|  | -            user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 |  | 
 | 
											
												
													
														|  | 
 |  | +            dt.images,dt.content as dt_content,dt.type as dt_type,dtuser.nickname as dtuser_nickname,dtuser.username as dtuser_username,usera.username,
 | 
											
												
													
														|  | 
 |  | +            usera.nickname,usera.avatar')
 | 
											
												
													
														|  |              ->join('topic_dongtai dt','a.dt_id = dt.id','LEFT')
 |  |              ->join('topic_dongtai dt','a.dt_id = dt.id','LEFT')
 | 
											
												
													
														|  |              ->join('user dtuser','dt.user_id = dtuser.id','LEFT')
 |  |              ->join('user dtuser','dt.user_id = dtuser.id','LEFT')
 | 
											
												
													
														|  | -            ->join('user user','a.user_id = user.id','LEFT')
 |  | 
 | 
											
												
													
														|  | -            ->join('user_wallet uw','user.id = uw.user_id','LEFT')
 |  | 
 | 
											
												
													
														|  | 
 |  | +            ->join('user usera','a.user_id = usera.id','LEFT')
 | 
											
												
													
														|  |              ->where($map)->order('a.id desc')->autopage()->select();
 |  |              ->where($map)->order('a.id desc')->autopage()->select();
 | 
											
												
													
														|  |          $list = list_domain_image($list,['avatar']);
 |  |          $list = list_domain_image($list,['avatar']);
 | 
											
												
													
														|  | -        if(!empty($list)){
 |  | 
 | 
											
												
													
														|  | -            foreach($list as $key => &$val){
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户年龄
 |  | 
 | 
											
												
													
														|  | -                $val['age'] = birthtime_to_age($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -                unset($val['birthday']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                //用户vip
 |  | 
 | 
											
												
													
														|  | -                $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
 |  | 
 | 
											
												
													
														|  | -                unset($val['vip_endtime']);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $this->success(1,$list);
 |  |          $this->success(1,$list);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
										
											
												
													
														|  | @@ -953,7 +547,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |          $this->success();
 |  |          $this->success();
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
											
												
													
														|  |      //我点赞的动态
 |  |      //我点赞的动态
 | 
											
												
													
														|  |      public function my_good(){
 |  |      public function my_good(){
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -968,7 +562,7 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |              ->field('dt.*,dt.id as dt_id,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 |  |              ->field('dt.*,dt.id as dt_id,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 | 
											
												
													
														|  |              ->where($where)
 |  |              ->where($where)
 | 
											
												
													
														|  |              ->order('dt.id desc')->autopage()->select();
 |  |              ->order('dt.id desc')->autopage()->select();
 | 
											
												
													
														|  | -        $list = list_domain_image($list,['images','audio_file','avatar']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $list = list_domain_image($list,['images','video_file','avatar']);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          if(!empty($list)){
 |  |          if(!empty($list)){
 | 
											
												
													
														|  |              foreach($list as $key => &$val){
 |  |              foreach($list as $key => &$val){
 | 
											
										
											
												
													
														|  | @@ -1000,19 +594,129 @@ class Topicdongtai extends Api
 | 
											
												
													
														|  |                  //层主评论数量
 |  |                  //层主评论数量
 | 
											
												
													
														|  |                  $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 |  |                  $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -                //话题
 |  | 
 | 
											
												
													
														|  | -                $ids_str = $val['topic_ids'];
 |  | 
 | 
											
												
													
														|  | -                if($ids_str){
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = Db::name('topic_hub')->where('id','IN',$val['topic_ids'])->orderRaw('field(id,'.$ids_str.')')->column('name');
 |  | 
 | 
											
												
													
														|  | -                }else{
 |  | 
 | 
											
												
													
														|  | -                    $val['topic_text'] = [];
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          $this->success('success',$list);
 |  |          $this->success('success',$list);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    //举报枚举
 | 
											
												
													
														|  | 
 |  | +    /*public function report_enum(){
 | 
											
												
													
														|  | 
 |  | +        $arr = [
 | 
											
												
													
														|  | 
 |  | +            '侮辱谩骂',
 | 
											
												
													
														|  | 
 |  | +            '色情低俗',
 | 
											
												
													
														|  | 
 |  | +            '政治敏感',
 | 
											
												
													
														|  | 
 |  | +            '违法违规',
 | 
											
												
													
														|  | 
 |  | +            '其他',
 | 
											
												
													
														|  | 
 |  | +        ];
 | 
											
												
													
														|  | 
 |  | +        $this->success(1,$arr);
 | 
											
												
													
														|  | 
 |  | +    }*/
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    //举报
 | 
											
												
													
														|  | 
 |  | +    public function report(){
 | 
											
												
													
														|  | 
 |  | +        $dt_id = input('dt_id',0);
 | 
											
												
													
														|  | 
 |  | +        $data['dt_id'] = $dt_id;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $check = Db::name('topic_dongtai')->where('id',$data['dt_id'])->find();
 | 
											
												
													
														|  | 
 |  | +        if(empty($check)){
 | 
											
												
													
														|  | 
 |  | +            $this->error('不存在的动态');
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $data['user_id']    = $this->auth->id;
 | 
											
												
													
														|  | 
 |  | +        $data['to_user_id'] = $check['user_id'];
 | 
											
												
													
														|  | 
 |  | +        $data['createtime'] = time();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        Db::name('topic_dongtai_report')->insertGetId($data);
 | 
											
												
													
														|  | 
 |  | +        $this->success('举报成功');
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    //收藏,取消收藏
 | 
											
												
													
														|  | 
 |  | +    public function collect(){
 | 
											
												
													
														|  | 
 |  | +        $where = [
 | 
											
												
													
														|  | 
 |  | +            'user_id'  => $this->auth->id,
 | 
											
												
													
														|  | 
 |  | +            'table'    => 'topic_dongtai',
 | 
											
												
													
														|  | 
 |  | +            'table_id' => input('id',0),
 | 
											
												
													
														|  | 
 |  | +        ];
 | 
											
												
													
														|  | 
 |  | +        $check = Db::name('user_collect')->where($where)->find();
 | 
											
												
													
														|  | 
 |  | +        if($check){
 | 
											
												
													
														|  | 
 |  | +            Db::name('user_collect')->where($where)->delete();
 | 
											
												
													
														|  | 
 |  | +            $this->success('已取消收藏');
 | 
											
												
													
														|  | 
 |  | +        }else{
 | 
											
												
													
														|  | 
 |  | +            Db::name('user_collect')->insertGetId($where);
 | 
											
												
													
														|  | 
 |  | +            $this->success('收藏成功');
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    //我的收藏
 | 
											
												
													
														|  | 
 |  | +    public function my_collect(){
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $collect_id = Db::name('user_collect')->where(['table'=>'topic_dongtai','user_id'=>$this->auth->id])->column('table_id');
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $where = ['dt.id'=>['IN',$collect_id]];
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $list = Db::name('topic_dongtai')->alias('dt')
 | 
											
												
													
														|  | 
 |  | +            ->join('user','dt.user_id = user.id','LEFT')
 | 
											
												
													
														|  | 
 |  | +            ->join('user_wallet uw','user.id = uw.user_id','LEFT')
 | 
											
												
													
														|  | 
 |  | +            ->field('dt.*,user.username,user.nickname,user.avatar,user.gender,user.birthday,user.attribute,user.idcard_status,uw.vip_endtime')
 | 
											
												
													
														|  | 
 |  | +            ->where($where)
 | 
											
												
													
														|  | 
 |  | +            ->order('dt.id desc')->autopage()->select();
 | 
											
												
													
														|  | 
 |  | +        $list = list_domain_image($list,['images','video_file','avatar']);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        if(!empty($list)){
 | 
											
												
													
														|  | 
 |  | +            foreach($list as $key => &$val){
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                $val['aite'] = json_decode($val['aite'],true);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //用户年龄
 | 
											
												
													
														|  | 
 |  | +                $val['age'] = birthtime_to_age($val['birthday']);
 | 
											
												
													
														|  | 
 |  | +                unset($val['birthday']);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //用户vip
 | 
											
												
													
														|  | 
 |  | +                $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
 | 
											
												
													
														|  | 
 |  | +                unset($val['vip_endtime']);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //追加点赞
 | 
											
												
													
														|  | 
 |  | +                $val['isgood'] = $this->is_good($val['id'],$this->auth->id);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //时间
 | 
											
												
													
														|  | 
 |  | +                $val['createtime_text'] = get_last_time($val['createtime']);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //关注
 | 
											
												
													
														|  | 
 |  | +                $val['is_follow'] = $this->is_follow($this->auth->id,$val['user_id']);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //收藏
 | 
											
												
													
														|  | 
 |  | +                $val['is_collect'] = $this->is_collect($val['id'],$this->auth->id);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //拉黑
 | 
											
												
													
														|  | 
 |  | +                $val['is_black'] = $this->is_black($this->auth->id,$val['user_id']);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                //层主评论数量
 | 
											
												
													
														|  | 
 |  | +                $val['answernumber'] = Db::name('topic_dongtai_answer')->where(['dt_id'=>$val['id'],'level'=>1])->count();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $this->success('success',$list);
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    //不感兴趣,屏蔽某条
 | 
											
												
													
														|  | 
 |  | +    /*public function screen(){
 | 
											
												
													
														|  | 
 |  | +        $data = [
 | 
											
												
													
														|  | 
 |  | +            'user_id' => $this->auth->id,
 | 
											
												
													
														|  | 
 |  | +            'dt_id'   => input('dt_id',0),
 | 
											
												
													
														|  | 
 |  | +        ];
 | 
											
												
													
														|  | 
 |  | +        $check = Db::name('topic_dongtai_screen')->where($data)->find();
 | 
											
												
													
														|  | 
 |  | +        if($check){
 | 
											
												
													
														|  | 
 |  | +            $this->success('操作成功');
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        Db::name('topic_dongtai_screen')->insertGetId($data);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        $this->success('操作成功');
 | 
											
												
													
														|  | 
 |  | +    }*/
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  }
 |  |  }
 |