FluxOrderFix.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Http\Controllers\Controller;
  4. use App\OracleDOCOrderHeader;
  5. use Carbon\Carbon;
  6. use Illuminate\Console\Command;
  7. class FluxOrderFix extends Command
  8. {
  9. /**
  10. * The name and signature of the console command.
  11. *
  12. * @var string
  13. */
  14. protected $signature = 'FluxOrderFix';
  15. /**
  16. * The console command description.
  17. *
  18. * @var string
  19. */
  20. protected $description = 'FluxOrderFix';
  21. /**
  22. * Create a new command instance.
  23. *
  24. * @return void
  25. */
  26. public function __construct()
  27. {
  28. parent::__construct();
  29. }
  30. /**
  31. * Execute the console command.
  32. *
  33. * @return mixed
  34. */
  35. public function handle()
  36. {
  37. $this->fixEdisendflagAtWrong();
  38. }
  39. public function fixEdisendflagAtWrong(){
  40. OracleDOCOrderHeader::where('edisendflag','W')
  41. ->whereNull('EDI_RESENDTIME')
  42. ->where('edisendtime','>',Carbon::now()->subDays(2))
  43. ->where('ediremarks2','<>','不支持的单据类型')
  44. ->update(['edisendflag'=>'N','manualflag'=>'N','EDI_RESENDTIME'=>Carbon::now()]);
  45. OracleDOCOrderHeader::where('edisendflag','W')
  46. ->where('EDI_RESENDTIME','>',Carbon::now()->subDays(2))
  47. ->where('edisendtime','>',Carbon::now()->subDays(2))
  48. ->where('ediremarks2','<>','不支持的单据类型')
  49. ->update(['edisendflag'=>'N','manualflag'=>'N']);
  50. }
  51. }