BookController.php 703 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace console\controllers;
  3. use common\components\noticeUtil;
  4. use yii\console\Controller;
  5. use Yii;
  6. class BookController extends Controller
  7. {
  8. public function actionAssignSeat()
  9. {
  10. ini_set('memory_limit', '2045M');
  11. set_time_limit(0);
  12. $cacheKey = 'assign_seat_main_book_sn_list';
  13. $num = Yii::$app->redis->executeCommand('SCARD', [$cacheKey]);
  14. if ($num <= 0) {
  15. return true;
  16. }
  17. if ($num > 20) {
  18. noticeUtil::push("assign seat all 已经超过20家了,请及时解决", '15280215347');
  19. }
  20. $eleList = Yii::$app->redis->executeCommand('SMEMBERS', [$cacheKey]);
  21. print_r($eleList);
  22. }
  23. }