两部轻松修改 ECSHOP后台修改会员列表显示会员等级,增加注册日期。
(1)打开admin/users.php文件。
搜索:$filter[‘keywords’] = stripslashes($filter[‘keywords’]);
把之前的$sql改为:
$sql= "SELECT user_id, user_name, email, is_validated, user_money, frozen_money, rank_points, pay_points, reg_time ,user_rank,r.rank_name as rank_name". " FROM " . $GLOBALS['ecs']->table('users') ." as u "." left join ".$GLOBALS['ecs']->table('user_rank') . " AS r ON u.user_rank = r.rank_id ". $ex_where ."ORDER by " . $filter['sort_by'] . ' ' . $filter['sort_order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
(2)继续搜索:$user_list[$i][‘reg_time’] = local_date($GLOBALS[‘_CFG’][‘date_format’], $user_list[$i][‘reg_time’]);
在下面添加一行:
$user_list[$i]['rank_name']=isset($user_list[$i]['rank_name'])?"[<font color=blue>".$user_list[$i]['rank_name']."</font>]":'';
(3)打开模板文件。即admin/templates/user_list.htm
增加到对应位置即可。如会员名称后面。
<td class=”first-cell”>{$user.user_name|escape} {$user.rank_name}</td>
同理,注册日期。加上字段:{$user.reg_time}
(4)显示效果如图示: