TestController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 Illuminate\Http\Request;
  12. use Illuminate\Support\Facades\DB;
  13. use Illuminate\Support\Facades\Http;
  14. class TestController extends Controller
  15. {
  16. use AsyncResponse,ErrorPush;
  17. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  18. private $data = [];
  19. public function __construct()
  20. {
  21. $this->data["active_test"] = "active";
  22. }
  23. public function method(Request $request, $method)
  24. {
  25. return call_user_func([$this, $method], $request);
  26. }
  27. public function lightUp()
  28. {
  29. app("CacheShelfService")->lightUp('HAIB1-02-02','3','2');
  30. }
  31. public function lightOff()
  32. {
  33. $params = [
  34. "areaCode" => "1004",
  35. 'locCode' => "HAIB1-02-02",
  36. 'PTLAction' => 0,
  37. ];
  38. $response = Http::post(config('api.haiq.storage.light'), $params);
  39. return json_decode($response->body());
  40. }
  41. public function test()
  42. {
  43. MaterialBoxModel::query()->where("id","!=",1)->delete();
  44. MaterialBoxModel::query()->where("id",1)->update([
  45. "description" => "单商品料箱"
  46. ]);
  47. }
  48. }