GlobalController.php 522 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace console\controllers;
  3. use bizGhs\product\classes\ProductClass;
  4. use Yii;
  5. use yii\console\Controller;
  6. /**
  7. * 全局脚本
  8. */
  9. class GlobalController extends Controller
  10. {
  11. // yii global/run
  12. public function actionRun()
  13. {
  14. //每5分钟执行一次,所有门店库存预警
  15. $hour = (int)date("H");
  16. if ($hour >= 7 and $hour <= 23) {
  17. if ((int)date('i') % 10 == 0) {
  18. ProductClass::allShopStockWarningFromQueue();
  19. }
  20. }
  21. }
  22. }