我试图调用getMenu()
中的函数(CommonFunction.php
)(location:components / CommonFunction.php),这将返回一些用户数据,但是当我转移了我的从godaddy(共享主机)到resellerclub(共享主机)的应用程序,显示错误。
表"用户"对于活跃的记录类"用户"无法在数据库中找到
abc()
中创建了一个功能(比如CommonFunctions.php
),该功能可以成功获取用户信息。getMenu
函数,但没有问题 commonFunction.php
public static function GetMenu($user_id = 0) {
$user_info = Users::model()->findByPk($user_id);
if (!isset($user_info) || count($user_info) < 1)
return;
$user_profile = UserProfile::model()->find('user_id=:user_id', array(':user_id' => $user_id));
$creteria = new CDbCriteria();
$creteria->condition = "contributor=\"$user_info->user_name\"";
$photo_upload_count = Godown::model()->count($creteria);
$creteria = new CDbCriteria();
$creteria->condition = "user_email=\"$user_info->email\"";
$photo_purchase_count = Downloads::model()->count($creteria);
//echo $photo_purchase_count; exit;
$creteria = new CDbCriteria();
$creteria->condition = "contributor_user_name=\"$user_info->user_name\"";
$photo_sale_count = Downloads::model()->count($creteria);
//echo $photo_sale_count; exit;
$base = Yii::app()->getBaseUrl(true);
$profile_pic_org = false;
$profile_dummy = "$base/images/profile-img.jpg";
if (isset($user_profile->profile_pic) && $user_profile->profile_pic != '') {
$profile_pic_url = "$base/profile-pic/thumb/" . $user_profile->profile_pic;
$profile_pic_org = "$base/profile-pic/" . $user_profile->profile_pic;
} else {
$profile_pic_url = "$base/images/profile-img.jpg";
$profile_pic_org = "$base/images/profile-img.jpg";
}
if (isset($user_profile) && count($user_profile) > 0) { // profile for the user is almost complete , we can fetch that info too;
$name = $user_profile->first_name . ' ' . $user_profile->last_name;
} else {
$a=explode('@', $user_info->email);
$name = reset($a);
}
if ($user_info->user_type == 'c') { // find the statics if and only if the user is a contributor
$creteria = new CDbCriteria();
$creteria->condition = "contributor=\"$user_info->user_name\" and display_status =\"\"";
$photo_pending_approval_count = Godown::model()->count($creteria);
$creteria = new CDbCriteria();
$creteria->condition = "contributor=\"$user_info->user_name\" and display_status =\"N\"";
$photo_rejected_count = Godown::model()->count($creteria);
$creteria = new CDbCriteria();
$creteria->condition = "contributor=\"$user_info->user_name\" and display_status =\"Y\"";
$photo_accepted_count = Godown::model()->count($creteria);
$folder = self::GetUploadFolder($user_id);
$folder = $folder['orginal'];
$penging_file_count = 0;
//echo $folder; exit;
}