You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
namespace tencent\wechat\weixin\material ;
use EasyWeChat\Factory ;
use tencent\wechat\weixin\Base ;
class Material extends Base
{
/**
* 获取全部素材列表
* @param string $type 素材的类型, 图片( image) 、视频( video) 、语音 ( voice) 、图文( news)
* @param int $offset 从全部素材的该偏移位置开始返回, 0表示从第一个素材 返回
* @param int $count 返回素材的数量, 取值在1到20之间
* @date 2022-12-01
*/
public function listMaterial ( $type , $offset , $count )
{
$app = Factory :: officialAccount ( $this -> weixinConfig );
$result = $app -> material -> list ( $type , $offset , $count );
// 记录日志
$uid = defined ( 'UID' ) ? UID : '' ;
platformLog ([
'type' => $type ,
'offset' => $offset ,
'count' => $count
], $result , 'easywechat_weixin_material_get_list_uid_' . $uid );
return $result ;
}
/**
* 获取素材计数
* @date 2022-12-01
*/
public function countMaterial ()
{
$app = Factory :: officialAccount ( $this -> weixinConfig );
$number = $app -> material -> stats ();
// 记录日志
$uid = defined ( 'UID' ) ? UID : '' ;
platformLog ([], $number , 'easywechat_weixin_material_count_uid_' . $uid );
return $number ;
}
}