首页突然出现问题Whoops, looks like something went wrong.


ErrorException in Taggable.php line 34:Trying to get property of non-object


  1. in Taggable.php line 34
  2. at HandleExceptions->handleError('8', 'Trying to get property of non-object', '/app/Models/Taggable.php', '34',array('tag' => object(stdClass), 'tagInfo' => null)) in Taggable.php line 34
  3. at Taggable::App\Models\{closure}(object(stdClass), '4')
  4. at array_map(object(Closure), array(object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass),object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass),object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass), object(stdClass)), array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19')) in Collection.php line 469
  5. at Collection->map(object(Closure))
  6. at call_user_func_array(array(object(Collection), 'map'), array(object(Closure))) in AbstractPaginator.php line 475
  7. at AbstractPaginator->__call('map', array(object(Closure))) in Taggable.php line 35
  8. at LengthAwarePaginator->map(object(Closure)) in Taggable.php line 35
  9. at Taggable::App\Models\{closure}() in Repository.php line 206
  10. at Repository->remember('hot_tags', '10', object(Closure))

之前好好的, 请问这是什么问题?看了下提示错误的 代码:

  /*全局热门标签*/

    public static function globalHotTags()
    {
        return Cache::remember('hot_tags',10,function(){
            $tags = self::hottest(25);
            $tags->map(function($tag){
                $tagInfo = Tag::find($tag->tag_id);
                $tag->name = $tagInfo->name;
            });
            return $tags;
        });
    }



请先 登录 后评论

3 个回答

Kylesean

数据之间的依赖关系,  你肯定用了非正常的方式删除了某些数据

请先 登录 后评论
宋登峰 - 官方技术支持
擅长:tipask,php,服务器,网站建设

登录到后台清空一下缓存看看

请先 登录 后评论
Beyoung 星海、阑珊

修改啦1231213213213213213213

请先 登录 后评论