TestCon.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\dao\Pay\PayError;
  4. use App\Facade\RedisConnect;
  5. use App\Facade\TableName;
  6. use Illuminate\Console\Command;
  7. use Illuminate\Support\Facades\DB;
  8. class TestCon extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'test_con';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Command description';
  22. /**
  23. * Create a new command instance.
  24. *
  25. * @return void
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. }
  31. /**
  32. * Execute the console command.
  33. *
  34. * @return mixed
  35. */
  36. public function handle()
  37. {
  38. $r = (new PayError())->create(2,'pay2');
  39. dd($r);
  40. $list = DB::table(TableName::agent() . 'admin_configs')
  41. ->where('type', 'pay')
  42. ->where('status', 1)
  43. ->orderBy('pay_error')
  44. ->orderByDesc('sort')
  45. ->pluck('name', 'id')->toArray();
  46. dd($list);
  47. // $redis = new RedisConnect();
  48. // // 判断开关
  49. // $open = 1;
  50. // $pay_id = 2; // 支付ID
  51. //
  52. // // 判断支付渠道
  53. // if (!$redis->redis()->exists('pay_channel')) {
  54. //
  55. // // 插表 -- 错误支付id存表
  56. //
  57. // DB::table(TableName::agent() . 'pay_poll')
  58. // ->updateOrInsert(['id' => 1], ['error_pay_id' => $pay_id . ',']);
  59. //
  60. // DB::table(TableName::agent() . 'admin_configs')->where('id', $id)->update(['pay_error' => 1]);
  61. //
  62. //
  63. // $list = DB::table(TableName::agent() . 'admin_configs')
  64. // ->where('type', 'pay')
  65. // ->where('status', 1)
  66. // ->orderBy('pay_error')
  67. // ->orderByDesc('sort')
  68. // ->pluck('name', 'id')->toArray();
  69. //
  70. //
  71. //
  72. //
  73. //
  74. // }
  75. }
  76. }