checkroutine.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. require_once 'CheckPoint.php';
  3. require_once "doctrine/bootstrap.php";
  4. use \CheckPoints\CheckPoint;
  5. //defined('YII_DEBUG') or define('YII_DEBUG', false);
  6. //defined('YII_ENV') or define('YII_ENV', 'prod');
  7. require_once 'api/vendor/autoload.php';
  8. //require_once 'api/vendor/yiisoft/yii2/Yii.php';
  9. $config = require_once 'api/config/web.php';
  10. //(new yii\web\Application($config));
  11. if (!isset($db_hostname))
  12. {
  13. require_once 'auth.php';
  14. require_once 'functions.php';
  15. }
  16. $echo = $_REQUEST['echo'];
  17. if (!isset($echo))
  18. $echo = false;
  19. /**
  20. * @var $company Company
  21. */
  22. $companies = $entityManager->getRepository('Company')->findAll();
  23. foreach ($companies as $company) {
  24. $company->CheckInvalidTasks($echo);
  25. $lazyaccs = $company->GetLazyAccounts();
  26. $offlineaccs = $company->GetOfflineAccounts();
  27. if ($echo)
  28. \Doctrine\Common\Util\Debug::dump($lazyaccs);
  29. $companyID = $company->id;
  30. CheckPush($lazyaccs, $echo); //напоминания о принятых, но неначатых задачах
  31. $urgent = $company->getUrgentProjects();
  32. // \Doctrine\Common\Util\Debug::dump($urgent);
  33. foreach ($urgent as $proj)
  34. if (intval($proj->getStatus()) < 5)
  35. TasksAssign('', true, $proj->id, $echo, 3000000000);
  36. TasksAssign('', true, 0, $echo, 3000000000);
  37. }