本文整理汇总了PHP中member::getMemberByIds方法的典型用法代码示例。如果您正苦于以下问题:PHP member::getMemberByIds方法的具体用法?PHP member::getMemberByIds怎么用?PHP member::getMemberByIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类member
的用法示例。
在下文中一共展示了member::getMemberByIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_member_info
/**
*
* Enter description here ...
* 获取会员信息
* @param unknown_type $member_id 会员ids
*/
private function get_member_info($member_id = array())
{
if (is_array($member_id)) {
if ($member_id[0]) {
$mem_ids = array_keys($member_id[0]);
//老会员
}
if ($member_id[1]) {
$mem_new_ids = array_keys($member_id[1]);
//新会员
}
}
if ($mem_new_ids) {
if (is_array($mem_new_ids)) {
$member_ids = implode(',', $mem_new_ids);
}
if ($member_ids) {
$this->create_curl_obj('members');
$params['member_id'] = $member_ids;
$params['a'] = 'show';
$params['r'] = 'member';
$member_new_infos = $this->get_common_datas($params);
if ($member_new_infos) {
foreach ($member_new_infos as $k => $v) {
$mem_info = array();
$mem_info['id'] = $v['member_id'];
//对手机用户名做处理
if (is_numeric($v['nick_name']) && strlen($v['nick_name']) == 11) {
$v['nick_name'] = str_replace(substr($v['nick_name'], 3, 4), '****', $v['nick_name']);
}
$mem_info['nick_name'] = $v['nick_name'];
$mem_info['avatar']['host'] = $v['avatar']['host'];
$mem_info['avatar']['dir'] = $v['avatar']['dir'];
$mem_info['avatar']['filepath'] = $v['avatar']['filepath'];
$mem_info['avatar']['filename'] = $v['avatar']['filename'];
$mem_infos[$v['member_id']] = $mem_info;
}
}
$member_info[1] = $mem_infos;
}
}
if ($mem_ids) {
if (is_array($mem_ids)) {
$member_ids = implode(',', $mem_ids);
}
include_once ROOT_PATH . 'lib/class/member.class.php';
$member = new member();
$member_infos = $member->getMemberByIds($member_ids);
$member_info[0] = $member_infos[0];
}
return $member_info;
}
示例2: show
public function show()
{
$this->verify_content_prms(array('_action' => 'manage'));
$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 10;
$limit = " limit {$offset}, {$count}";
$orders = array('id');
$descasc = strtoupper($this->input['hgupdn']);
if ($descasc != 'ASC') {
$descasc = 'DESC';
}
if (in_array($this->input['hgorder'], $orders)) {
$orderby = ' ORDER BY ' . $this->input['hgorder'] . ' ' . $descasc;
} else {
$orderby = ' ORDER BY m.order_id ' . $descasc;
}
$condition = $this->get_condition();
$field = ' m.id,m.title,m.content_url,m.app_uniqueid,m.mod_uniqueid,m.userid,m.username,m.member_id,m.author,m.pub_time,m.ip,m.ip_info,m.state,m.content,m.useful,m.yawp,m.contentid,m.cmid,m.appname,m.order_id,m.content_title,m.last_reply,n.name as groupname ';
$join = ' LEFT JOIN ' . DB_PREFIX . 'message_node n ON m.groupid = n.id ';
$mes = new Message();
$res = $mes->show($field, $condition, $orderby, $limit, $join);
//需要会员信息
$need_member_info = intval($this->input['need_member_info']);
if (is_array($res) && count($res)) {
$cmid = array();
$member_id = array();
//获取有多少内容发布后id
foreach ($res as $key => $val) {
//抓取会员id
if ($need_member_info && $val['member_id']) {
$member_id[$val['member_id']] = 1;
}
//获取发布id
if ($val['cmid']) {
$cmid['app'][$val['cmid']] = 0;
} else {
//栏目
if ($val['app_uniqueid'] == 'column' && $val['mod_uniqueid'] == 'column') {
$cmid['column'][$val['contentid']] = 1;
}
}
}
//获取会员信息
if ($need_member_info && $member_id) {
include_once ROOT_PATH . 'lib/class/member.class.php';
$member = new member();
$mem_ids = array_keys($member_id);
$member_id = implode(',', $mem_ids);
$member_info = $member->getMemberByIds($member_id);
$member_info = $member_info[0];
}
//查询每个发布内容的标题
if (count($cmid)) {
$arr = array();
foreach ($cmid as $key => $val) {
foreach ($val as $k => $v) {
if ($key == 'app') {
$r = $mes->get_publish_content($k);
$v = trim($this->input['content_title']);
$arr['app'][$k] = $v;
} else {
if ($key == 'column') {
$r = $mes->get_publish_content($k, $v);
$v = trim($this->input['content_title']);
$arr['column'][$k] = $v;
}
}
}
}
}
//整合输出内容
foreach ($res as $k => $v) {
//添加内容标题
if (count($arr)) {
if ($v['cmid']) {
foreach ($arr['app'] as $kk => $vv) {
if ($kk == $v['cmid']) {
$v['content_title'] = $vv;
}
}
} else {
if ($v['contentid'] && $v['app_uniqueid'] == 'column') {
if ($arr['column']) {
foreach ($arr['column'] as $kk => $vv) {
if ($kk == $v['contentid']) {
$v['content_title'] = $vv;
}
}
}
}
}
}
$v['status'] = $v['state'];
//状态判断
if ($v['state'] == '1') {
$v['state'] = '已审核';
} else {
if ($v['state'] == '2') {
$v['state'] = '已打回';
} else {
//.........这里部分代码省略.........