|
|
@@ -429,11 +429,11 @@ class TestService extends Service
|
|
|
}
|
|
|
|
|
|
//-----------------------------------朗峰u8-----
|
|
|
- public function getToken(){
|
|
|
- list($status, $msg) = $this->SetU8();
|
|
|
+ public function getToken($common_array){
|
|
|
+ list($status, $msg) = $this->SetU8($common_array);
|
|
|
if(! $status) return [false , $msg];
|
|
|
$host = $msg;
|
|
|
- $key = "lf_u8_long_token_demo";
|
|
|
+ $key = "lf_u8_long_token_demo_" . $common_array['site'];
|
|
|
if(! Cache::has($key)){
|
|
|
$url = $host . "/api/System/GetToken";
|
|
|
$date = date("Y-m-d");
|
|
|
@@ -460,8 +460,8 @@ class TestService extends Service
|
|
|
return [true, [$host, $token]];
|
|
|
}
|
|
|
|
|
|
- public function salesOrderGet($data){
|
|
|
- list($status, $msg) = $this->getToken();
|
|
|
+ public function salesOrderGet($data, $common_array){
|
|
|
+ list($status, $msg) = $this->getToken($common_array);
|
|
|
if(! $status) return [false, $msg];
|
|
|
list($host, $token) = $msg;
|
|
|
|
|
|
@@ -537,11 +537,14 @@ class TestService extends Service
|
|
|
return [true, $return];
|
|
|
}
|
|
|
|
|
|
- private function SetU8(){
|
|
|
- $api_host = env('API_HOST');
|
|
|
- if(empty($api_host)) return [false, '用友对外域名不存在'];
|
|
|
- $api_port = env('API_PORT');
|
|
|
- if(empty($api_port)) return [false, '用友对外域名端口不存在'];
|
|
|
+ private function SetU8($common_array){
|
|
|
+// $api_host = env('API_HOST');
|
|
|
+// if(empty($api_host)) return [false, '用友对外域名不存在'];
|
|
|
+// $api_port = env('API_PORT');
|
|
|
+// if(empty($api_port)) return [false, '用友对外域名端口不存在'];
|
|
|
+ $api_host = $common_array['api_host'];
|
|
|
+ $api_port = $common_array['api_port'];
|
|
|
+
|
|
|
//映射ip是否通畅
|
|
|
$bool = $this->isDomainAvailable($api_host);
|
|
|
if(! $bool) return [false, '用友对外域名不可达'];
|
|
|
@@ -570,8 +573,8 @@ class TestService extends Service
|
|
|
return [true, $result['data']['DataTable1']];
|
|
|
}
|
|
|
|
|
|
- public function materialAddU8($data){
|
|
|
- list($status, $msg) = $this->getToken();
|
|
|
+ public function materialAddU8($data,$common_array){
|
|
|
+ list($status, $msg) = $this->getToken($common_array);
|
|
|
if(! $status) return [false, $msg];
|
|
|
list($host, $token) = $msg;
|
|
|
|
|
|
@@ -597,8 +600,8 @@ class TestService extends Service
|
|
|
return [true, $result['data']];
|
|
|
}
|
|
|
|
|
|
- public function productInAddU8($data){
|
|
|
- list($status, $msg) = $this->getToken();
|
|
|
+ public function productInAddU8($data,$common_array){
|
|
|
+ list($status, $msg) = $this->getToken($common_array);
|
|
|
if(! $status) return [false, $msg];
|
|
|
list($host, $token) = $msg;
|
|
|
|
|
|
@@ -623,8 +626,8 @@ class TestService extends Service
|
|
|
return [true, $result['data']];
|
|
|
}
|
|
|
|
|
|
- public function dispatchAddU8($data){
|
|
|
- list($status, $msg) = $this->getToken();
|
|
|
+ public function dispatchAddU8($data,$common_array){
|
|
|
+ list($status, $msg) = $this->getToken($common_array);
|
|
|
if(! $status) return [false, $msg];
|
|
|
list($host, $token) = $msg;
|
|
|
|