TestController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Components\AsyncResponse;
  4. use App\Components\ErrorPush;
  5. use App\ErrorTemp;
  6. use App\Feature;
  7. use App\MaterialBoxModel;
  8. use App\Owner;
  9. use App\OwnerFeeDetail;
  10. use App\OwnerPriceOperation;
  11. use App\RejectedBill;
  12. use App\Unit;
  13. use Illuminate\Http\Request;
  14. use Illuminate\Support\Facades\DB;
  15. use Illuminate\Support\Facades\Http;
  16. class TestController extends Controller
  17. {
  18. use AsyncResponse,ErrorPush;
  19. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  20. private $data = [];
  21. public function __construct()
  22. {
  23. $this->data["active_test"] = "active";
  24. }
  25. public function method(Request $request, $method)
  26. {
  27. return call_user_func([$this, $method], $request);
  28. }
  29. public function lightUp()
  30. {
  31. app("CacheShelfService")->lightUp('HAIB1-02-02','3','2');
  32. }
  33. public function lightOff()
  34. {
  35. $params = [
  36. "areaCode" => "1004",
  37. 'locCode' => "HAIB1-02-02",
  38. 'PTLAction' => 0,
  39. ];
  40. $response = Http::post(config('api.haiq.storage.light'), $params);
  41. return json_decode($response->body());
  42. }
  43. public function test()
  44. {
  45. dd(!!Unit::query()->first());
  46. }
  47. }