|
@@ -25,7 +25,10 @@ class Base
|
|
$this->connect['set'][$v['key']] = $v['value'];
|
|
$this->connect['set'][$v['key']] = $v['value'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- $this->info = Dever::db($this->type, 'connect')->find(array('type' => $type, 'cate_id' => $cate_id, 'connect_id' => $this->connect['id']));
|
|
|
|
|
|
+ $this->info = false;
|
|
|
|
+ if ($cate_id) {
|
|
|
|
+ $this->info = Dever::db($this->type, 'connect')->find(array('type' => $type, 'cate_id' => $cate_id, 'connect_id' => $this->connect['id']));
|
|
|
|
+ }
|
|
if (!$this->info) {
|
|
if (!$this->info) {
|
|
$this->info = Dever::db($this->type, 'connect')->find(array('type' => $type, 'connect_id' => $this->connect['id']));
|
|
$this->info = Dever::db($this->type, 'connect')->find(array('type' => $type, 'connect_id' => $this->connect['id']));
|
|
if (!$this->info) {
|
|
if (!$this->info) {
|
|
@@ -85,6 +88,8 @@ class Base
|
|
echo Dever::json_encode($result);die;
|
|
echo Dever::json_encode($result);die;
|
|
}
|
|
}
|
|
//$response = '{"code":1,"info":"ok","data":{"order":"Q202401037683854738260576","account":"15810090845","status":1}}';
|
|
//$response = '{"code":1,"info":"ok","data":{"order":"Q202401037683854738260576","account":"15810090845","status":1}}';
|
|
|
|
+ //$response = '{"status":0,"msg":"success","order_id":"24013117320741438be7f0b65a","product_id":20005,"price":104.1,"amount":100,"user_order":"C2024013193480488567061"}';
|
|
|
|
+ $response = '{"status":"0","msg":"success","balance":"100.0000","frozen_balance":"9.9800"}';
|
|
$response = $this->response($response);
|
|
$response = $this->response($response);
|
|
$response['request'] = $body;
|
|
$response['request'] = $body;
|
|
return $response;
|
|
return $response;
|
|
@@ -172,7 +177,8 @@ class Base
|
|
}
|
|
}
|
|
$msg = '';
|
|
$msg = '';
|
|
$status = 2;
|
|
$status = 2;
|
|
- if ($code = Dever::isset($response, $this->connect['response_code'])) {
|
|
|
|
|
|
+ if (isset($response[$this->connect['response_code']])) {
|
|
|
|
+ $code = $response[$this->connect['response_code']];
|
|
$code = Dever::db('response_code', 'connect')->find(array('connect_id' => $this->connect['id'], 'value' => $code));
|
|
$code = Dever::db('response_code', 'connect')->find(array('connect_id' => $this->connect['id'], 'value' => $code));
|
|
if ($code && $code['type'] == 1) {
|
|
if ($code && $code['type'] == 1) {
|
|
$status = 1;
|
|
$status = 1;
|
|
@@ -192,7 +198,7 @@ class Base
|
|
$temp = explode('.', $this->connect['response_data']);
|
|
$temp = explode('.', $this->connect['response_data']);
|
|
$data = isset($response[$temp[0]][$temp[1]]) ? $response[$temp[0]][$temp[1]] : (isset($response[$temp[0]]) ? $response[$temp[0]] : false);
|
|
$data = isset($response[$temp[0]][$temp[1]]) ? $response[$temp[0]][$temp[1]] : (isset($response[$temp[0]]) ? $response[$temp[0]] : false);
|
|
} else {
|
|
} else {
|
|
- $data = $response[$this->connect['response_data']] ?? false;
|
|
|
|
|
|
+ $data = $response[$this->connect['response_data']] ?? $response;
|
|
}
|
|
}
|
|
if ($data) {
|
|
if ($data) {
|
|
if (method_exists($this, 'responseHandle')) {
|
|
if (method_exists($this, 'responseHandle')) {
|