<?php

/*
 * Copyright (C) xgcms.com
 */

class report extends base_model {
	function __construct(&$conf) {
		parent::__construct($conf);
		$this->table = 'report';
		$this->primarykey = array('rid');
		$this->maxcol = 'rid';
	}
		// 取list
	public function get_report_list($start,$pagesize) {
		$list = $this->index_fetch('', array('dateline'=>2),$start,$pagesize);
		return $list;
	}
	// 用来显示给用户
	public function format(&$report) {
		if(empty($report)) return;
		empty($_SERVER['miscarr']) && $_SERVER['miscarr'] = $this->mcache->read('miscarr');
		$miscarr = $_SERVER['miscarr'];
		$report['fname'] = isset($miscarr['forum'][$report['fid']]) ? $miscarr['forum'][$report['fid']] : '';
		$report['dateline']=misc::minidate($report['dateline'], $this->conf['timeoffset']);

	}
	public function _delete($id) {
		$return = $this->delete($id);
		return $return;
	}
	public function get_by_uid_pid($uid,$pid){
		$list = $this->index_fetch(array('pid'=>$pid,'uid'=>$uid), array(), 0, 100);
		return $list;
	}
}
?>
	
	