:EcStore批量生成评论和购买记录插件,自动采集淘宝天猫评论APP,兼容所有ecs版本!!   智加设计技术支持技术支持:
   
当前位置: ECSTORE开发 > 商品评论和咨询隐藏会员手机号中间四位
推荐() 收藏()

商品评论和咨询隐藏会员手机号中间四位

【 作者:admin     来源: 智加设计,ecstore    点击数: 2300     更新时间: 2018-06-12
  摘要:  商品评论和咨询隐藏会员手机号中间四位

商品评论和咨询隐蔽会员手机号中间四位

只需要修改一个文件  b2c/lib/message/disask.php 找到如下方法替换即可

    function getGoodsIndexComments($gid,$item,$page=1,$type_id=null,$limit){
        if($limit){
            $list_listnum = $limit;
        }else{
            $list_listnum = intval($this->app->getConf('comment.index.listnum'));
        }
        $this->objComment->type = $item;
        $filter['for_comment_id'] = 0;
        $filter['type_id'] = $gid;
        $filter['display'] = 'true';
        if($type_id) $filter['gask_type'] = $type_id;
        $count = $this->count($filter);
        $maxPage = ceil($count / $list_listnum);
        if($page > $maxPage) $page = $maxPage;
        $start = ($page-1) * $list_listnum;
        $start = $start<0 ? 0 : $start;
        $aData = $this->getList('*',$filter,$start,$list_listnum);
        $data = array();
        $point_status = app::get('b2c')->getConf('goods.point.status') ? app::get('b2c')->getConf('goods.point.status'): 'on';
        $goods_point = $this->app->model('comment_goods_point');
        foreach((array)$aData as $key=>$val){
            if($val['object_type'] == 'discuss' && $point_status == 'on'){
                $row = $goods_point->get_comment_point($val['comment_id']);
                $val['goods_point'] = $row;
            }
            //如果是手机号那就隐蔽中间四位
            if(preg_match('/^1[345789]{1}[0-9]{9}/',$val['author'])){
                $val['author']=preg_replace('/(1[345789]{1}[0-9])[0-9]{4}([0-9]{4})/i','$1****$2',$val['author']);
            }
            $data[] = $val;
        }
        $result['start'] = $start+1;
        $result['end'] = $start+$list_listnum;
        $result['total'] = $count;
        $result['data'] = $data;
        $result['page'] = $maxPage;
        $result['current_page'] = $page;
        return $result;
    }

如有任何疑问都可以直接联系QQ:2392521892来解答。

评论加载中............
运行信息( 0.0315 秒):关闭X