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


PHP UserModule::get_by_id方法代码示例

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


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

示例1: get_all

 public function get_all($condition, $next_id, $count)
 {
     if ($next_id === NULL || $count === NULL) {
         $next_id = 0;
         $count = 10;
     }
     $score_record_list = $this->scoremod->get_all($condition, $next_id, $count);
     foreach ($score_record_list as $score_record) {
         // 人物名称
         $user_id = $score_record->user->uuid;
         $userMod = new UserModule($user_id);
         $user_info = $userMod->get_by_id($user_id);
         $score_record->user = $user_info[0];
         // 规则名称
         $rule_id = $score_record->rule->id;
         $rule_info = $this->scoremod->get_by_id($rule_id);
         $score_record->rule = $rule_info;
     }
     return $score_record_list;
 }
开发者ID:samuel072,项目名称:PHP,代码行数:20,代码来源:score_service.php

示例2: get_comment_by_vid

 /**
  * 根据视频直播的id  查询出对应的评论列表
  * @param unknown $vid
  */
 public function get_comment_by_vid($vid)
 {
     $table = new CommentTable();
     $comm_list = $table->get_comments_by_vid($vid);
     $userModule = new UserModule(@$user_id);
     date_default_timezone_set("Asia/Shanghai");
     foreach ($comm_list as $comment) {
         $user_info = $userModule->get_by_id($comment->user->uuid);
         $now_time = date("Y-m-d H:i:s");
         $comm_sub_time = $comment->subtime;
         $timestamp = strtotime($now_time) - strtotime($comm_sub_time);
         $str_time = "";
         if ($timestamp < 0) {
             $str_time = $timestamp;
         } else {
             if ($timestamp < 60) {
                 //
                 $str_time = $timestamp . "秒前";
             } else {
                 if ($timestamp < 3600) {
                     $str_time = floor($timestamp / 60) . "分钟前";
                 } else {
                     if ($timestamp < 86400) {
                         $str_time = floor($timestamp / 3600) . "小时前";
                     } else {
                         if ($timestamp < 259200) {
                             // 3天
                             $str_time = floor($timestamp / 86400) . "天前";
                         } else {
                             $str_time = "3天以前";
                         }
                     }
                 }
             }
         }
         $comment->subtime = $str_time;
         // 距离现在过了多久
         $comment->user = $user_info[0];
     }
     return $comm_list;
 }
开发者ID:samuel072,项目名称:PHP,代码行数:45,代码来源:comment_service.php

示例3: CommentModel

$video_id = $json_param->video_id;
$detail = $json_param->detail;
$comment = new CommentModel();
$comment->user->uuid = $user_id;
$comment->video_live->id = $video_id;
$comment->detail = $detail;
$table = new CommentTable();
$rcode = $table->insert_comment($comment);
$message = "";
if (!$rcode) {
    $message = "评论失败";
} else {
    $comm = $table->get_by_id($rcode);
    $userModule = new UserModule(@$user_id);
    date_default_timezone_set("Asia/Shanghai");
    $user_info = $userModule->get_by_id($comm->user->uuid);
    $scoreSer = new ScoreService();
    $rule_list = $scoreSer->apply_rule($user_info, GET_SCORE, ScoreModule::point_comment);
    file_put_contents("/tmp/yike.log", "rule_liist --->" . $rule_list, FILE_APPEND);
    if ($rule_list) {
        $message = "";
        foreach ($rule_list as $rule) {
            $msg = $rule->title . " + " . $rule->amount;
            $message[] = $msg;
        }
        $user_info = $userModule->get_by_id($comm->user->uuid);
    }
    $now_time = date("Y-m-d H:i:s");
    $comm_sub_time = $comm->subtime;
    $timestamp = strtotime($now_time) - strtotime($comm_sub_time);
    $str_time = "";
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:user_video_comment.php

示例4: update_profile

 /**
  * 修改用户的昵称
  * @param $name 用户的唯一昵称
  * @param $uuid 用户的唯一标识符
  * return 返回的是用户的基本信息
  */
 public function update_profile($uuid, $name)
 {
     $userModule = new UserModule($uuid);
     // 检查昵称是否被占用
     $is_nick_name = $userModule->check_name($name);
     if ($is_nick_name == 1) {
         $user = $userModule->update_profile($uuid, $name);
         if ($user) {
             return $userModule->get_by_id($uuid);
         } else {
             return DB_ERR_NO_DATA;
         }
     } else {
         return NICK_NAME_IS_ALREADY;
     }
 }
开发者ID:samuel072,项目名称:PHP,代码行数:22,代码来源:user_service.php


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