Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新微信文章的时候MatialEasyWeChat\Material,如果设置了show_pic_cover和content_source_url不会生效 #470

Closed
niceguy-php opened this issue Jul 27, 2016 · 1 comment

Comments

@niceguy-php
Copy link

niceguy-php commented Jul 27, 2016

我用的环境

PHP 版本:
overtrue/wechat 版本:3.0

问题及现象

更新微信文章的时候MatialEasyWeChat\Material,如果设置了show_pic_cover和content_source_url不会生效,修改代码如下即可修复(----包括的内容),还请官方及时处理,以免别人遇到同样问题
描述你的问题现象,报错贴截图粘贴或者贴具体信息,提供必要的代码段
public function updateArticle($mediaId, $article, $index = 0)
{
$params = [
'media_id' => $mediaId,
'index' => $index,
'articles' => isset($article['title']) ? $article : (isset($article[$index]) ? $article[$index] : []),
];
//--------------------fix by yyx
$article instanceof Article && $params['articles'] = $article->only([
'title', 'thumb_media_id', 'author', 'digest',
'show_cover_pic', 'content', 'content_source_url',
]);
//---------------------------------------

    return $this->parseJSON('json', [self::API_NEWS_UPDATE, $params]);
}
@niceguy-php niceguy-php changed the title 更新微信文章的时候MatialEasyWeChat\Material,如果设置了 更新微信文章的时候MatialEasyWeChat\Material,如果设置了show_pic_cover和content_source_url不会生效 Jul 27, 2016
@overtrue overtrue reopened this Jul 27, 2016
@overtrue
Copy link
Collaborator

贴代码请用 markdown 格式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants