| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace console\controllers;
- use common\components\noticeUtil;
- use yii\console\Controller;
- use Yii;
- class BookController extends Controller
- {
- public function actionAssignSeat()
- {
- ini_set('memory_limit', '2045M');
- set_time_limit(0);
- $cacheKey = 'assign_seat_main_book_sn_list';
- $num = Yii::$app->redis->executeCommand('SCARD', [$cacheKey]);
- if ($num <= 0) {
- return false;
- }
- if ($num > 20) {
- noticeUtil::push("assign seat all 已经超过20家了,请及时解决", '15280215347');
- }
- $list = Yii::$app->redis->executeCommand('SMEMBERS', [$cacheKey]);
- if (empty($list)) {
- return false;
- }
- foreach ($list as $key => $val) {
- //$mainId . '_' . $bookSn
- $arr = explode('_', $val);
- $mainId = $arr[0];
- $bookSn = $arr[1];
- echo $mainId . ' ' . $bookSn . "\n";
- }
- }
- }
|