QueueController.class.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Mobile\Controller;
  3. class QueueController extends MobileController
  4. {
  5. public function index()
  6. {
  7. }
  8. //匹配交易
  9. public function checkDapan()
  10. {
  11. // 处理开盘闭盘交易时间===开始
  12. $times = date('G', time());
  13. $minute = date('i', time());
  14. $minute = intval($minute);
  15. foreach (C('market') as $k => $v) {
  16. if (($times <= $v['start_time'] && $minute < intval($v['start_minute'])) || ($times > $v['stop_time'] && $minute >= intval($v['stop_minute']))) {
  17. continue;
  18. }
  19. if (($times < $v['start_time']) || $times > $v['stop_time']) {
  20. continue;
  21. } else {
  22. if ($times == $v['start_time']) {
  23. if ($minute < intval($v['start_minute'])) {
  24. continue;
  25. }
  26. } elseif ($times == $v['stop_time']) {
  27. if (($minute > $v['stop_minute'])) {
  28. continue;
  29. }
  30. }
  31. }
  32. // 处理周六周日是否可交易===开始
  33. $weeks = date('N', time());
  34. if (!$v['agree6']) {
  35. if ($weeks == 6) {
  36. continue;
  37. }
  38. }
  39. if (!$v['agree7']) {
  40. if ($weeks == 7) {
  41. continue;
  42. }
  43. }
  44. //处理周六周日是否可交易===结束
  45. A('Trade')->matchingTradeall($v['name']);//匹配交易
  46. }
  47. }
  48. }
  49. ?>