TestController.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Commodity;
  4. use App\CommodityMaterialBoxModel;
  5. use App\Components\AsyncResponse;
  6. use App\Components\ErrorPush;
  7. use App\ErrorTemp;
  8. use App\Feature;
  9. use App\Jobs\CacheShelfTaskJob;
  10. use App\Jobs\OrderCreateWaybill;
  11. use App\MaterialBox;
  12. use App\MaterialBoxModel;
  13. use App\Order;
  14. use App\Owner;
  15. use App\OwnerFeeDetail;
  16. use App\OwnerPriceOperation;
  17. use App\OrderPackageCountingRecord;
  18. use App\RejectedBill;
  19. use App\Services\ForeignHaiRoboticsService;
  20. use App\Services\StationService;
  21. use App\Services\StorageService;
  22. use App\Station;
  23. use App\StationTask;
  24. use App\StationTaskMaterialBox;
  25. use App\TaskTransaction;
  26. use App\Unit;
  27. use App\Waybill;
  28. use Carbon\Carbon;
  29. use Carbon\CarbonPeriod;
  30. use Illuminate\Database\Eloquent\Collection;
  31. use Illuminate\Http\Request;
  32. use Illuminate\Support\Facades\Cache;
  33. use Illuminate\Support\Facades\Auth;
  34. use Illuminate\Support\Facades\Cookie;
  35. use Illuminate\Support\Facades\DB;
  36. use Illuminate\Support\Facades\Http;
  37. class TestController extends Controller
  38. {
  39. use AsyncResponse,ErrorPush;
  40. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  41. private $data = [];
  42. public function __construct()
  43. {
  44. $this->data["active_test"] = "active";
  45. }
  46. public function method(Request $request, $method)
  47. {
  48. return call_user_func([$this, $method], $request);
  49. }
  50. public function lightUp()
  51. {
  52. app("CacheShelfService")->lightUp('HAIB1-02-02','3','0');
  53. }
  54. public function lightOff()
  55. {
  56. $params = [
  57. "areaCode" => "1004",
  58. 'locCode' => "HAIB1-02-02",
  59. 'PTLAction' => 0,
  60. ];
  61. $response = Http::post(config('api.haiq.storage.light'), $params);
  62. return json_decode($response->body());
  63. }
  64. public function a($a){
  65. $test = ["asdas"];
  66. $a($test);
  67. dd($test);
  68. }
  69. public function test()
  70. {
  71. $this->a(function (&$test){
  72. $test[] = 123;
  73. });
  74. }
  75. }