|
|
@@ -105,19 +105,9 @@ class TestController extends Controller
|
|
|
app(BatchUpdateService::class)->batchUpdate('inventory_accounts',$updateParams);
|
|
|
}
|
|
|
}
|
|
|
- public function zui(){
|
|
|
-
|
|
|
- $d = ["ada","超管","hospital_1","测试","hospital_5"];
|
|
|
- $a = [];
|
|
|
- foreach ($d as $item){
|
|
|
- $arr = explode("_",$item);
|
|
|
- if (count($arr) === 2 && $arr[0] == 'hospital' && is_numeric($arr[1]))$a[] = $arr[1];
|
|
|
- }
|
|
|
- dd($a);
|
|
|
- }
|
|
|
public function zzd()
|
|
|
{
|
|
|
- $post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
|
|
|
+ /*$post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
|
|
|
"method"=>"warpText",
|
|
|
"mergeColumn"=>["column"],
|
|
|
"mergeRow"=>["row"=>"row"],
|
|
|
@@ -141,8 +131,30 @@ class TestController extends Controller
|
|
|
"log"=>"log",
|
|
|
"file"=>""
|
|
|
]]);
|
|
|
- $http = new Client();
|
|
|
- $response = $http->get("http://localhost:9722", ["type"=>"base","format"=>[
|
|
|
+ if ($post->status() == 500){
|
|
|
+ throw new Exception($post->header("Msg"));
|
|
|
+ }
|
|
|
+ $test = "test";
|
|
|
+ return response($post,200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
|
|
|
+ ]);*/
|
|
|
+ $http = new Client(['base_uri' => 'http://localhost:9722','timeout'=>2.0]);
|
|
|
+ /** @var $response */
|
|
|
+
|
|
|
+ $response = $http->request('POST', '/',[
|
|
|
+ 'headers'=>[
|
|
|
+ 'Accept' => 'application/json',
|
|
|
+ ],
|
|
|
+ "json"=>["type"=>"base","data"=>[
|
|
|
+ "row"=>["sql-row"],
|
|
|
+ "list"=>[["sql-list"]],]]
|
|
|
+ ]);
|
|
|
+ return response($response->getBody()->getContents(),200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=测试.xlsx",
|
|
|
+ ]);
|
|
|
+ $response = $http->post("http://localhost:9722", ["form_params"=>["type"=>"base",/*"format"=>[
|
|
|
"method"=>"warpText",
|
|
|
"mergeColumn"=>["column"],
|
|
|
"mergeRow"=>["row"=>"row"],
|
|
|
@@ -157,15 +169,15 @@ class TestController extends Controller
|
|
|
"charset"=>"char",
|
|
|
"parsetime"=>"pars",
|
|
|
"sid"=>"",
|
|
|
- ],"data"=>[
|
|
|
+ ],*/"data"=>[
|
|
|
"row"=>["sql-row"],
|
|
|
"list"=>[["sql-list"]],
|
|
|
- "sql"=>"sql",
|
|
|
- "rule"=>["sql"=>"rule"],
|
|
|
- ],"path"=>[
|
|
|
+ /*"sql"=>"sql",
|
|
|
+ "rule"=>["sql"=>"rule"],*/
|
|
|
+ ]/*,"path"=>[
|
|
|
"log"=>"log",
|
|
|
"file"=>""
|
|
|
- ]]);
|
|
|
+ ]*/]]);
|
|
|
if ($response->getStatusCode() == 500){
|
|
|
throw new \Exception($response->getHeader("Msg"));
|
|
|
}
|
|
|
@@ -178,7 +190,7 @@ class TestController extends Controller
|
|
|
throw new Exception($post->header("Msg"));
|
|
|
}
|
|
|
$test = "test";
|
|
|
- return response($response->get,200, [
|
|
|
+ return response($response,200, [
|
|
|
"Content-type"=>"application/octet-stream",
|
|
|
"Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
|
|
|
]);
|