예제 #1
0
function recommendShow()
{
    if (getvar('admin', 'session')) {
        $current = getvar('p', 'get');
        $current = empty($current) ? 1 : $current;
        $recommend = new Recommend();
        $name = getvar('name', 'get');
        if (!empty($name)) {
            $name = '%' . $name . '%';
        }
        $data = $recommend->find($name, array($current, '?r=recommendShow', 15));
        global $db;
        template('recommend.php', array('recommends' => $data, 'pagination' => $db->getPage()));
    } else {
        setHint('请先登录');
        redirect('login');
    }
}
예제 #2
0
 public function getShowRecommend($id)
 {
     $recommend = Recommend::find($id);
     $columns = Schema::getColumnListing('recommend');
     return View::make('admin.show_recommend')->with('recommend', $recommend)->with('columns', $columns);
 }