\WeChat\ExtendJson

Class Json json输出类

Summary

Methods
Properties
Constants
__construct()
error()
success()
return_abnormal()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(\WeChat\Extend\string  $message = "", \WeChat\Extend\int  $code, \Throwable  $previous = null) 

Parameters

\WeChat\Extend\string $message
\WeChat\Extend\int $code
\Throwable $previous

error()

error(string  $msg = '请求失败') 

请求失败

Parameters

string $msg

success()

success(string  $msg = '请求成功', array  $data = array()) 

请求成功

Parameters

string $msg

返回消息

array $data

返回data数据

return_abnormal()

return_abnormal(integer  $code, string  $msg, array  $data = array()) 

输出JSON

Parameters

integer $code

状态码

string $msg

原因

array $data

输出数据