作者 jinglong

新增资料下载列表

... ... @@ -16,7 +16,8 @@ class CommonController extends HomeBaseController
{
//七牛云域名
const domain = 'http://jinglong.springchunjia.cn/';
//分页数量
const limit = 10;
//查找单条数据
public static function findData($table,$where,$field){
$res = Db::name($table)
... ...
<?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 ContactController extends HomeBaseController
{
//联系我们
//联系我们详情
public function contactDetail(){
$language = $this->request->param('language');
if(isset($language) && !empty($language)){
//英文
$field_contact = 'id,company_name_en,address_en,mobile,phone,wx,email';
}else{
//中文
$field_contact = 'id,company_name,address,mobile,phone,wx,email';
}
$res = CommonController::findData('contact',['id'=>1],$field_contact);
$this->assign('res',$res);
return $this->fetch();
}
}
... ...
<?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();
}
}
... ...
... ... @@ -48,10 +48,11 @@ class SeriesController extends HomeBaseController
->where(['t_id'=>$children_id])
->field($field_series)
->order('id desc')
->paginate(10,false,['query'=>request()->param()]);
->paginate(CommonController::limit,false,['query'=>request()->param()]);
$data = $res->toArray();
$data = $data['data'];
$page = $res->render();
$this->assign('res',$data['data']);
$this->assign('res',$data);
$this->assign('page',$page);
return $this->fetch();
}
... ...