TestController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Components\AsyncResponse;
  4. use App\Components\Database;
  5. use App\Components\ErrorPush;
  6. use App\Services\WaybillService;
  7. use App\Waybill;
  8. use Illuminate\Http\Request;
  9. use Illuminate\Support\Facades\DB;
  10. class TestController extends Controller
  11. {
  12. use AsyncResponse, ErrorPush, Database;
  13. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  14. public function __construct()
  15. {
  16. $this->data["active_test"] = "active";
  17. }
  18. public function method(Request $request, $method)
  19. {
  20. try {
  21. return call_user_func([$this, $method], $request);
  22. }catch (\BadMethodCallException $e){
  23. dd("方法不存在");
  24. }
  25. }
  26. public function test(){
  27. $arr = DB::connection("oracle")->select(DB::raw("SELECT LOCATIONID FROM INV_LOT_LOC_ID
  28. where LOCATIONID like 'IDE%' and CUSTOMERID in ('PUHE')
  29. group by CUSTOMERID,LOCATIONID order by CUSTOMERID"));
  30. $str = "";
  31. foreach ($arr as $item){
  32. $str .= '"'.$item->locationid.'",';
  33. }
  34. dd($str);
  35. }
  36. }