PaymentOrder.php 978 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use App\Models\PaymentOrder as PaymentOrderModel;
  5. class PaymentOrder extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = 'payment:order';
  13. /**
  14. * The console command description.
  15. *
  16. * @var string
  17. */
  18. protected $description = '人工提现/人工充值订单24小时未处理的自动失败';
  19. /**
  20. * Execute the console command.
  21. *
  22. * @return int
  23. */
  24. public function handle()
  25. {
  26. //人工充值/提现订单
  27. $list = PaymentOrderModel::whereIn('status', [0,1,5])->whereIn('type', [3,4])->where('created_at', '>', date('Y-m-d H:i:s', strtotime('-1 day')))->limit(200)->get();
  28. foreach ($list as $item) {
  29. $item->status = 3;
  30. $item->remark = '超时未处理,自动失败';
  31. $item->save();
  32. }
  33. }
  34. }