|
@@ -77,7 +77,7 @@ function http($url, $param, $method = 'post')
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function jsonSuccess($data = [], $msg = "成功")
|
|
|
|
|
|
+ function jsonSuccess($data = [], $msg = "成功", $extra = [])
|
|
{
|
|
{
|
|
$response = array(
|
|
$response = array(
|
|
'code' => 0,
|
|
'code' => 0,
|
|
@@ -95,13 +95,22 @@ function http($url, $param, $method = 'post')
|
|
'pagination' => $data['meta']['pagination']
|
|
'pagination' => $data['meta']['pagination']
|
|
)
|
|
)
|
|
);
|
|
);
|
|
|
|
+ if($extra){
|
|
|
|
+ $temp['data'] = array_merge($temp['data'], $extra);
|
|
|
|
+ }
|
|
$response = array_merge($response, $temp);
|
|
$response = array_merge($response, $temp);
|
|
} elseif(isset($data['data'])) {
|
|
} elseif(isset($data['data'])) {
|
|
|
|
+ if($extra){
|
|
|
|
+ $data['data'] = array_merge($data['data'], $extra);
|
|
|
|
+ }
|
|
$response = array_merge($response, $data);
|
|
$response = array_merge($response, $data);
|
|
}else{
|
|
}else{
|
|
$temp = array(
|
|
$temp = array(
|
|
'data' => $data
|
|
'data' => $data
|
|
);
|
|
);
|
|
|
|
+ if($extra){
|
|
|
|
+ $temp['data'] = array_merge($temp['data'], $extra);
|
|
|
|
+ }
|
|
$response = array_merge($response, $temp);
|
|
$response = array_merge($response, $temp);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|