redisPubSub; $redisPubSub->setOptReadTimeout(-1); $redisPubSub->subscribe($name, function ($instance, $channelName, $message) { $a = 123; }); } public function actionPub() { $name = 'redis_shi'; $time = 'nihao1123'; $redisPubSub = \Yii::$app->redisPubSub; $redisPubSub->publish($name, $time); } public function actionPullUser() { //拉取用户 $this->actionPullUser(); } // 拉取微信用户 ssh 2019.9.9 public function actionPullUser2() { $sjId = 12359; $return = UserService::syncWxAllUser($sjId); $total = isset($return['data']['total']) ? $return['data']['total'] : 0; xhMerchantAssetService::updateBySjId($sjId, ['totalFans' => $total]); } //更新用户名称 public function actionUpdateName() { $sjId = 12362; UserService::syncWxAllUser($sjId); } //消息模板初始化 linqh ./yii init/t-message public function actionTMessage() { xhTMessageService::initTMessage(); } }