add clear
This commit is contained in:
+1
-1
@@ -151,7 +151,7 @@ class Recharge extends Miniprogarampage
|
|||||||
$this->request->setCallback(function ($data) {
|
$this->request->setCallback(function ($data) {
|
||||||
$array = Help::toArray($data);
|
$array = Help::toArray($data);
|
||||||
if ($array['result_code'] != 'SUCCESS') {
|
if ($array['result_code'] != 'SUCCESS') {
|
||||||
$data = ['code' => 500, 'message' => $array['err_code_des']];
|
$data = ['code' => $array['err_code'], 'message' => $array['err_code_des']];
|
||||||
} else {
|
} else {
|
||||||
$data = ['code' => 0, 'message' => '支付成功'];
|
$data = ['code' => 0, 'message' => '支付成功'];
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-18
@@ -19,17 +19,17 @@ class Result
|
|||||||
public $count = 0;
|
public $count = 0;
|
||||||
public $data;
|
public $data;
|
||||||
public $header;
|
public $header;
|
||||||
|
|
||||||
public function __construct(array $data)
|
public function __construct(array $data)
|
||||||
{
|
{
|
||||||
foreach ($data as $key => $val) {
|
foreach ($data as $key => $val) {
|
||||||
$this->$key = $val;
|
$this->$key = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->header = $this->reloadResponse($this->header);
|
$this->header = $this->reloadResponse($this->header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $header
|
* @param $header
|
||||||
*
|
*
|
||||||
@@ -50,20 +50,20 @@ class Result
|
|||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get($name)
|
public function __get($name)
|
||||||
{
|
{
|
||||||
return $this->$name;
|
return $this->$name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function __set($name, $value)
|
public function __set($name, $value)
|
||||||
{
|
{
|
||||||
$this->$name = $value;
|
$this->$name = $value;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTime()
|
public function getTime()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -72,7 +72,7 @@ class Result
|
|||||||
'runTime' => $this->runTime,
|
'runTime' => $this->runTime,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $key
|
* @param $key
|
||||||
* @param $data
|
* @param $data
|
||||||
@@ -87,13 +87,16 @@ class Result
|
|||||||
$this->$key = $data;
|
$this->$key = $data;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function isResultsOK()
|
public function isResultsOK()
|
||||||
{
|
{
|
||||||
|
if (!is_numeric($this->code)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return $this->code == 0;
|
return $this->code == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* 批量设置返回头
|
* 批量设置返回头
|
||||||
@@ -104,7 +107,7 @@ class Result
|
|||||||
$this->setHeader($key, $val);
|
$this->setHeader($key, $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $key
|
* @param $key
|
||||||
* @param $val
|
* @param $val
|
||||||
@@ -114,7 +117,7 @@ class Result
|
|||||||
{
|
{
|
||||||
header($key . ':' . $val);
|
header($key . ':' . $val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@@ -129,7 +132,7 @@ class Result
|
|||||||
}
|
}
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $key
|
* @param $key
|
||||||
* @param $data
|
* @param $data
|
||||||
@@ -140,12 +143,12 @@ class Result
|
|||||||
$this->data[$key] = $data;
|
$this->data[$key] = $data;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMessage()
|
public function getMessage()
|
||||||
{
|
{
|
||||||
return $this->message;
|
return $this->message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCode()
|
public function getCode()
|
||||||
{
|
{
|
||||||
return $this->code;
|
return $this->code;
|
||||||
|
|||||||
Reference in New Issue
Block a user