DownloadController.php
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\Db;
class DownloadController extends HomeBaseController
{
//资料下载列表
public function contactDetail(){
$language = $this->request->param('language');
if(isset($language) && !empty($language)){
//英文
$field_contact = 'id,title_en,file_url';
}else{
//中文
$field_contact = 'id,title,file_url';
}
$res = Db::name('download')
->field($field_contact)
->order('id desc')
->paginate(CommonController::limit,false,['query'=>request()->param()]);
$data = $res->toArray();
$data = $data['data'];
$page = $res->render();
$this->assign('list',$data);
$this->assign('page',$page);
return $this->fetch();
}
}