当前位置: 首页>>代码示例>>PHP>>正文


PHP CUtil::setUserCode方法代码示例

本文整理汇总了PHP中CUtil::setUserCode方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::setUserCode方法的具体用法?PHP CUtil::setUserCode怎么用?PHP CUtil::setUserCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CUtil的用法示例。


在下文中一共展示了CUtil::setUserCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUserDetails

 public static function getUserDetails($user_id)
 {
     $user_fields = \Config::get('webshoppack::user_fields');
     $user_id_field = \Config::get('webshoppack::user_id_field');
     $user_table = \Config::get('webshoppack::user_table');
     $user_details = array();
     $fields = '';
     foreach ($user_fields as $key => $field) {
         if ($fields != '') {
             $fields .= ', ';
         }
         $fields .= $field . ' AS ' . $key;
     }
     $user_info = \DB::select('SELECT ' . $fields . ' FROM ' . $user_table . ' WHERE ' . $user_id_field . ' = \'' . $user_id . '\'');
     if (count($user_info) > 0) {
         foreach ($user_info as $user_det) {
             $user_details['user_code'] = CUtil::setUserCode($user_id);
             if (isset($user_det->fname)) {
                 $user_details['first_name'] = $user_det->fname;
             }
             if (isset($user_det->lname)) {
                 $user_details['last_name'] = $user_det->lname;
             }
             if (isset($user_det->email)) {
                 $user_details['email'] = $user_det->email;
             }
             if (isset($user_det->fname) && isset($user_det->lname)) {
                 $user_details['display_name'] = ucfirst($user_det->fname) . ' ' . ucfirst(substr($user_det->lname, 0, 1));
             }
         }
     }
     $user_details['profile_url'] = \URL::to(\Config::get('webshopauthenticate::uri')) . "/" . $user_details['user_code'];
     //."-". strtolower(str_replace(" ","", $user_details['first_name']));
     return $user_details;
 }
开发者ID:agriya,项目名称:webshoppack,代码行数:35,代码来源:CUtil.php

示例2: fetchUserDetails

 public function fetchUserDetails($ident, $type)
 {
     $search_cond = 'users.user_id = ' . $ident;
     if ($type == 'code') {
         $search_cond = 'users.user_code = ' . $ident;
     }
     $user_details = array();
     $user_details['err_msg'] = '';
     $user_details['own_profile'] = 'No';
     $udetails = User::whereRaw($search_cond)->first(array('users.first_name', 'users.id', 'users.last_name', 'users.email', 'users.activated', 'users.activated_at'));
     if (count($udetails) > 0) {
         $user_details['user_code'] = CUtil::setUserCode($udetails['id']);
         $user_details['email'] = $udetails['email'];
         $user_details['user_id'] = $user_id = $udetails['id'];
         $user_details['first_name'] = $udetails['first_name'];
         $user_details['last_name'] = $udetails['last_name'];
         $user_display_name = $udetails['first_name'] . ' ' . substr($udetails['last_name'], 0, 1);
         $user_details['display_name'] = ucwords($user_display_name);
         $user_details['activated_at'] = $udetails['activated_at'];
         $user_details['activated'] = $udetails['activated'];
     } else {
         $user_details['err_msg'] = 'No such user found';
     }
     return $user_details;
 }
开发者ID:agriya,项目名称:webshoppack,代码行数:25,代码来源:AdminManageShopService.php


注:本文中的CUtil::setUserCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。