Product
extends BasicWeChat
in
商店管理 Class Product
Table of Contents
$config | 当前微信配置 | DataArray |
---|---|---|
$access_token | 访问AccessToken | string |
$currentMethod | 当前请求方法参数 | array |
$isTry | 当前模式 | bool |
$cache | 静态缓存 | static |
$GetAccessTokenCallback | 注册代替函数 | string |
modStatus() | 提交审核/取消发布商品 | array |
setTestWhiteList() | 设置测试人员白名单 | array |
getQrcode() | 获取商品二维码 | array |
getProduct() | 查询商品信息 | array |
getProductList() | 批量查询商品信息 | array |
updateProduct() | 更新商品信息 | array |
clearProduct() | 清除商品信息 | array |
scanTicketCheck() | 检查wxticket参数 | array |
clearScanticket() | 清除扫码记录 | array |
__construct() | BasicWeChat constructor. | mixed |
instance() | 静态创建对象 | static |
getAccessToken() | 获取访问accessToken | string |
setAccessToken() | 设置外部接口 AccessToken | mixed |
delAccessToken() | 清理删除 AccessToken | bool |
httpGetForJson() | 以GET获取接口数据并转为数组 | array |
httpPostForJson() | 以POST获取接口数据并转为数组 | array |
registerApi() | 注册当前请求接口 | mixed |
callPostApi() | 接口通用POST请求方法 | array |
callGetApi() | 接口通用GET请求方法 | array |
Properties
$config
当前微信配置
public
DataArray
$config
$access_token
访问AccessToken
public
string
$access_token
= ''
$currentMethod
当前请求方法参数
protected
array
$currentMethod
= []
$isTry
当前模式
protected
bool
$isTry
= false
$cache
静态缓存
protected
static static
$cache
$GetAccessTokenCallback
注册代替函数
protected
string
$GetAccessTokenCallback
Methods
modStatus()
提交审核/取消发布商品
public
modStatus(
$keystandard :
string
, $keystr :
string
[, $status :
string
= 'on' ]
)
: array
Parameters
- $keystandard : string
商品编码标准
- $keystr : string
商品编码内容
- $status : string = 'on'
设置发布状态。on为提交审核,off为取消发布
Tags
Return values
arraysetTestWhiteList()
设置测试人员白名单
public
setTestWhiteList(
[ $openids :
array
= [] ]
[, $usernames :
array
= [] ]
)
: array
Parameters
- $openids : array = []
测试人员的openid列表
- $usernames : array = []
测试人员的微信号列表
Tags
Return values
arraygetQrcode()
获取商品二维码
public
getQrcode(
$keystandard :
string
, $keystr :
string
, $qrcode_size :
int
[, $extinfo :
array
= [] ]
)
: array
Parameters
- $keystandard : string
商品编码标准
- $keystr : string
商品编码内容
- $qrcode_size : int
二维码的尺寸(整型),数值代表边长像素数,不填写默认值为100
- $extinfo : array = []
由商户自定义传入,建议仅使用大小写字母、数字及-_().*这6个常用字符
Tags
Return values
arraygetProduct()
查询商品信息
public
getProduct(
$keystandard :
string
, $keystr :
string
)
: array
Parameters
- $keystandard : string
商品编码标准
- $keystr : string
商品编码内容
Tags
Return values
arraygetProductList()
批量查询商品信息
public
getProductList(
$offset :
int
[, $limit :
int
= 10 ]
[, $status :
null|string
= null ]
[, $keystr :
string
= '' ]
)
: array
Parameters
- $offset : int
批量查询的起始位置,从0开始,包含该起始位置
- $limit : int = 10
批量查询的数量
- $status : null|string = null
支持按状态拉取。on为发布状态,off为未发布状态,check为审核中状态,reject为审核未通过状态,all为所有状态
- $keystr : string = ''
支持按部分编码内容拉取。填写该参数后,可将编码内容中包含所传参数的商品信息拉出。类似关键词搜索
Tags
Return values
arrayupdateProduct()
更新商品信息
public
updateProduct(
$data :
array
)
: array
Parameters
- $data : array
Tags
Return values
arrayclearProduct()
清除商品信息
public
clearProduct(
$keystandard :
string
, $keystr :
string
)
: array
Parameters
- $keystandard : string
商品编码标准
- $keystr : string
商品编码内容
Tags
Return values
arrayscanTicketCheck()
检查wxticket参数
public
scanTicketCheck(
$ticket :
string
)
: array
Parameters
- $ticket : string
Tags
Return values
arrayclearScanticket()
清除扫码记录
public
clearScanticket(
$keystandard :
string
, $keystr :
string
, $extinfo :
string
)
: array
Parameters
- $keystandard : string
商品编码标准
- $keystr : string
商品编码内容
- $extinfo : string
调用“获取商品二维码接口”时传入的extinfo,为标识参数
Tags
Return values
array__construct()
BasicWeChat constructor.
public
__construct(
$options :
array
)
: mixed
Parameters
- $options : array
Return values
mixedinstance()
静态创建对象
public
static instance(
$config :
array
)
: static
Parameters
- $config : array
Return values
staticgetAccessToken()
获取访问accessToken
public
getAccessToken(
)
: string
Tags
Return values
stringsetAccessToken()
设置外部接口 AccessToken
public
setAccessToken(
$access_token :
string
)
: mixed
Parameters
- $access_token : string
Tags
Return values
mixeddelAccessToken()
清理删除 AccessToken
public
delAccessToken(
)
: bool
Return values
boolhttpGetForJson()
以GET获取接口数据并转为数组
protected
httpGetForJson(
$url :
string
)
: array
Parameters
- $url : string
接口地址
Tags
Return values
arrayhttpPostForJson()
以POST获取接口数据并转为数组
protected
httpPostForJson(
$url :
string
, $data :
array
[, $buildToJson :
bool
= true ]
)
: array
Parameters
- $url : string
接口地址
- $data : array
请求数据
- $buildToJson : bool = true
Tags
Return values
arrayregisterApi()
注册当前请求接口
protected
registerApi(
&$url :
string
, $method :
string
[, $arguments :
array
= [] ]
)
: mixed
Parameters
- $url : string
接口地址
- $method : string
当前接口方法
- $arguments : array = []
请求参数
Tags
Return values
mixedcallPostApi()
接口通用POST请求方法
public
callPostApi(
$url :
string
, $data :
array
[, $isBuildJson :
bool
= true ]
)
: array
Parameters
- $url : string
接口URL
- $data : array
POST提交接口参数
- $isBuildJson : bool = true
Tags
Return values
arraycallGetApi()
接口通用GET请求方法
public
callGetApi(
$url :
string
)
: array
Parameters
- $url : string
接口URL