Commit d5b5a1b9 authored by 蒋林's avatar 蒋林

对外相关接口开发

parent 91d84bd3
......@@ -62,6 +62,24 @@ class Suning extends BaseController
$obj->ReturnMessage(true, '', $result);
}
//服务订单作业查询
public function receiveServiceOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveObj();
$obj->SetValues($param);
$obj->CheckReceiveServiceOrderValues();
$values = $obj->GetValues();
$this->saveLog('', 'receiveServiceOrder', $values);
$sourceObj = $this->sourceObj($values['account'], $values['pwd']);
$result = $sourceObj->ReceiveServiceOrder($values['object']);
$obj->ReturnMessage(true, '', $result);
}
//服务订单查询条件
public function selectServiceOrderCondition()
{
......
......@@ -34,6 +34,14 @@ class ReceiveSuning extends Receive
}
}
public function CheckReceiveServiceOrderValues()
{
$fileds = ['object'];
$this->CheckValues($fileds);
$this->values['object'] = json_decode($this->values['object'], true);
}
public function CheckSelectServiceOrderConditionValues()
{
$this->CheckValues();
......
......@@ -72,7 +72,7 @@ class Source
} else {
$post = http_build_query($post);
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
......
......@@ -168,7 +168,12 @@ class SourceSuning extends Source
//debug
$this->Debug('ReceiveServiceOrder', $result);
return $result;
$res = [];
if (isset($result['data']) && $result['data']) {
$res = json_decode($result['data'], true);
}
return $res;
}
/**
......@@ -639,7 +644,7 @@ class SourceSuning extends Source
{
$result = parent::CurlPostHttps($url, $post, $headers, $type);
if ($result['data']) {
if (isset($result['data']) && $result['data']) {
$result['data'] = gzdecode($result['data']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment