|
@@ -47,7 +47,7 @@ class WeixinService extends Service
|
|
|
$post = [
|
|
|
'offset' => $offset,
|
|
|
'count' => $count,
|
|
|
- 'no_content' => 0,
|
|
|
+ 'no_content' => 1,
|
|
|
];
|
|
|
$result = $this->curlOpen($url, ['post' => json_encode($post)]);
|
|
|
$result = json_decode($result,true);
|
|
@@ -57,6 +57,32 @@ class WeixinService extends Service
|
|
|
return [true, ['data' => $result['item'] ?? [], 'total' => $result['total_count'], 'data_count' => $result['item_count']]];
|
|
|
}
|
|
|
|
|
|
+ public function getPublicWxArticleDetail($data){
|
|
|
+ list($status, $msg) = $this->rule($data);
|
|
|
+ if(! $status) {
|
|
|
+ file_put_contents('record_ip.txt',date("Y-m-d H:i:s",time()).json_encode($data) . PHP_EOL."来源IP".$msg.PHP_EOL,8);
|
|
|
+ return [false, 'IP未入白名单'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(empty($data['article_id'])) return [false, '文章ID不能为空'];
|
|
|
+
|
|
|
+ list($status, $msg) = $this->getToken();
|
|
|
+ if(! $status) return [false, $msg];
|
|
|
+
|
|
|
+ $config = config('qingyaoWx');
|
|
|
+ $url = sprintf($config['get_article_detail'], $msg);
|
|
|
+
|
|
|
+ $post = [
|
|
|
+ 'article_id' => $data['article_id'],
|
|
|
+ ];
|
|
|
+ $result = $this->curlOpen($url, ['post' => json_encode($post)]);
|
|
|
+ $result = json_decode($result,true);
|
|
|
+
|
|
|
+ if(isset($result['errmsg'])) return [false, $result['errmsg']];
|
|
|
+
|
|
|
+ return [true, ['data' => $result['news_item'] ?? [] ]];
|
|
|
+ }
|
|
|
+
|
|
|
public function getPublicWxMaterial($data){
|
|
|
list($status, $msg) = $this->rule($data);
|
|
|
if(! $status) {
|