Files
2026-10-14 14:00:29 +08:00

79 lines
2.2 KiB
PHP

<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
use app\index\model\Join as JoinModel;
/**
* 加入我们
*/
class Join extends Base
{
public function initialize()
{
$this->model = new JoinModel();
parent::initialize();
}
/**
* 显示资源列表
*/
public function index():string
{
$inputData = $this->request->param();
$join = [];
$join['banner'] = $this->model->getJoinBanner($this->languageId,'加入我们-banner');
$join['list'] = $this->model->getJoinList($this->languageId,$inputData);
$join['type'] = $this->model->getJoinTypeList($this->languageId,$inputData);
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'join');
View::assign('meta',$metaTitle);
View::assign('join',$join);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'join/join_us');
}
/**
* 显示详情资源列表
*/
public function detail():string
{
$inputData = $this->request->param();
//banner
$join = $this->model->getInfo($inputData);
View::assign('join',$join);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'join/join_detail');
}
/**
* 更多列表页
*/
public function list():string
{
$inputData = $this->request->param();
$where = [
'site_id' => $this->languageId,
'status' => 0,
];
if (isset($inputData['join_type_id']) && $inputData['join_type_id'] != 0) {
$where['join_type_id'] = $inputData['join_type_id'];
}
$listRow = [
'query' => ['join_type_id'=>$inputData['join_type_id']], //url额外参数
'fragment' => '', //url锚点
'var_page' => 'page', //分页变量
'list_rows' => $inputData['size']??4, //每页数量
];
$result = $this->model->where($where)->paginate($listRow);
View::assign('join',$result->render());
View::assign('list',$result->toArray());
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'join/join_list');
}
}