<?php
namespace app\admin\controller;
use think\App;
use think\facade\Session;
use think\facade\View;
use think\facade\Request;
 
class recycle extends Base{

	//Images首页
    public function index(){
		$tdata=Request::param();
		$auto_page=tq_value(1,'auto_page','system');
		$auto_page_num=tq_value(1,'page_num','system');

		View::assign(['auto_page'=>$auto_page,'auto_page_num'=>$auto_page_num]);
		return View::fetch();
    }

	//列表数据		
    public function list_data(){
		IS_AJAX(Request::isAjax());
		$tdata=Request::param();

		
		$map = [];
		$map[] = ['is_delete','=',0];
		$list=\app\admin\model\Article::where($map)
			 ->order('sort desc,create_time desc')
			 ->paginate(['list_rows' =>$tdata['limit'],'query' => request()->param(),])->toArray();
		
		foreach($list['data'] as $k=>$c){
			$list['data'][$k]['catename']=tq_value($c['pid'],'catename','cate');
		}
		
		$data['code']=0;
		$data['count']=$list['total'];
		$data['data']=$list['data'];
		
		return json($data);
    }

	
}
