本文整理汇总了PHP中Reply::show方法的典型用法代码示例。如果您正苦于以下问题:PHP Reply::show方法的具体用法?PHP Reply::show怎么用?PHP Reply::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reply
的用法示例。
在下文中一共展示了Reply::show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
function show()
{
$data['_action'] = 'manage';
$this->verify_content_prms($data);
$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 r.id desc ';
}
$condition = $this->get_condition();
$obj = new Reply();
$res = $obj->show($condition, $orderby, $limit);
if (count($res)) {
foreach ($res as $k => $v) {
if ($v['state'] == '1') {
$v['state'] = '已审核';
} else {
if ($v['state'] == '2') {
$v['state'] = '打回';
} else {
$v['state'] = '待审核';
}
}
if (!$v['answerer']) {
$v['answerer'] = $v['ip'];
}
$this->addItem($v);
}
}
$this->output();
}