[英]YII2 user management
don't know why it happens, here is the sample of the code 不知道为什么会发生,这是代码示例
$uid = Yii::$app->user->identity->ID;
if($id != null){
$model = self::findOne($id);
}
else{
$model = self::find()->select('ID, connection_uri, version, username, password')->where('
enabled = :en AND user_id = :userid
' ,[':en' => 1, ':userid' => $uid])->one();
}
When this line is being processed $uid = Yii::$app->user->identity->ID;
处理此行时, $uid = Yii::$app->user->identity->ID;
the whole server is getting very slower and I cannot do any other thing only to wait while the function is being finished. 整个服务器的运行速度越来越慢,我只能等待功能完成时再做其他事情。 When I delete that line and for example type this : $uid = 1;
例如,当我删除该行时,键入: $uid = 1;
then everything is ok. 那一切都还好 Do you have any ideas why it might happen? 你有什么想法为什么会发生?
尝试:
$uid = Yii::$app->user->identity->id;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.