链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB

  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use DB;
  5. class OnlineOrderStatis extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = 'command:OnlineOrderStatis';
  13. /**
  14. * The console command description.
  15. *
  16. * @var string
  17. */
  18. protected $description = 'Command 在线订单情况统计';
  19. /**
  20. * Create a new command instance.
  21. *
  22. * @return void
  23. */
  24. public function __construct()
  25. {
  26. parent::__construct();
  27. }
  28. /**
  29. * Execute the console command.
  30. *
  31. * @return int
  32. */
  33. public function handle()
  34. {
  35. $ret = DB::select("select main.id as '系统订单号',
  36. main.order_num '订单号',
  37. main.global_order_id '全局订单ID',
  38. main.money '实付金额',
  39. main.total_money '订单原金额',
  40. main.yhq_money2 '优惠金额',
  41. market.name '市场名',
  42. main.user_id '下单用户ID',
  43. user.name '系统用户名',
  44. main.name '下单用户名',
  45. main.address '下单用户地址',
  46. FROM_UNIXTIME(main.time_add,'%Y-%m-%d %H:%i:%s') '下单时间'
  47. FROM ims_cjdc_order_main `main`
  48. INNER JOIN ims_cjdc_user `user` ON user.id=main.user_id
  49. INNER JOIN `ims_cjdc_market` `market` ON main.`market_id`=market.id
  50. where `time_add` >= 1599148800 and `time_add` <=1599235199 and `type` = 1 and state IN (4,5,10)");
  51. $totalCount = count($ret);
  52. foreach ($ret as $key => $item) {
  53. }
  54. return 0;
  55. }
  56. }