|
|
@@ -110,13 +110,17 @@ class TestController extends Controller
|
|
|
app(BatchUpdateService::class)->batchUpdate('inventory_accounts', $updateParams);
|
|
|
}
|
|
|
}
|
|
|
- public function zui(){
|
|
|
- $a = new \Illuminate\Support\Collection(["a"=>"b"]);
|
|
|
- foreach ($a as $i=>$l)dump($i,$l);
|
|
|
+ public function roleCallback($type,$f1,$f2,$f3)
|
|
|
+ {
|
|
|
+ if ($type==1)return $f1();
|
|
|
+ if ($type==2)return $f2([2]);
|
|
|
+ if ($type==3)return $f3;
|
|
|
}
|
|
|
public function zzd()
|
|
|
{
|
|
|
- $post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
|
|
|
+ dd(Carbon::parse("adsa")->format('Y-m-d'));
|
|
|
+ dd(PHP_OS);
|
|
|
+ /*$post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
|
|
|
"method"=>"warpText",
|
|
|
"mergeColumn"=>["column"],
|
|
|
"mergeRow"=>["row"=>"row"],
|
|
|
@@ -140,8 +144,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 new \GuzzleHttp\Psr7\Response(200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=测试.xlsx",
|
|
|
+ ],$response->getBody()->getContents());
|
|
|
+ $response = $http->post("http://localhost:9722", ["form_params"=>["type"=>"base",/*"format"=>[
|
|
|
"method"=>"warpText",
|
|
|
"mergeColumn"=>["column"],
|
|
|
"mergeRow"=>["row"=>"row"],
|
|
|
@@ -156,15 +182,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"));
|
|
|
}
|
|
|
@@ -177,7 +203,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',
|
|
|
]);
|