Compare commits

..

6 Commits

Author SHA1 Message Date
0b2b3ec85f Merge branch 'dev' 2025-07-09 09:52:59 +08:00
4f2ecd1276 fix: nas页面从pc重定向到mobile时丢失参数问题 2025-07-09 09:52:45 +08:00
614a1b696f Merge branch 'dev' 2025-07-07 14:43:39 +08:00
6ef860f24f fix: nas帮助中心union子句因无limit情况排序错误问题 2025-07-07 14:40:56 +08:00
6865b6bea5 Merge branch 'dev' 2025-04-17 10:08:31 +08:00
42b2242570 refactor: 去除多余banner查询 2025-04-17 10:08:08 +08:00
5 changed files with 16 additions and 14 deletions

View File

@@ -85,9 +85,9 @@ class BaseController extends Controller
$ctrl = \think\helper\Str::snake($this->controller);
if ($ctrl == 'tops_nas') {
if ($this->country_code == 'US') {
return $this->redirect(url("@usmobile/$ctrl/$action"));
return $this->redirect(url("@usmobile/$ctrl/$action", $this->request->param()));
}
return $this->redirect(url("@mobile/$ctrl/$action"));
return $this->redirect(url("@mobile/$ctrl/$action", $this->request->param()));
}
if (strpos($domain, 'orico.cc')) {

View File

@@ -341,7 +341,7 @@ class TopsNas extends BaseController
$model = \think\Db::table($sub_query . ' a');
foreach ($categorys as $key => $val) {
if ($key == 0) continue;
$model->union(function($query) use($val, $limit) {
$model->union(function($query) use($key, $val, $limit) {
$query->name('article')->field([
'id',
'cid',
@@ -355,6 +355,8 @@ class TopsNas extends BaseController
if (!empty($limit)) {
$query->limit($limit);
}
// 嵌套子查询解决union没有limit时排序问题
$query->table($query->buildSql() . 'a' . $key);
});
}

View File

@@ -293,7 +293,7 @@ class TopsNas extends BaseController
$model = \think\Db::table($sub_query . ' a');
foreach ($categorys as $key => $val) {
if ($key == 0) continue;
$model->union(function($query) use($val, $limit) {
$model->union(function($query) use($key, $val, $limit) {
$query->name('article')->field([
'id',
'cid',
@@ -307,6 +307,8 @@ class TopsNas extends BaseController
if (!empty($limit)) {
$query->limit($limit);
}
// 嵌套子查询解决union没有limit时排序问题
$query->table($query->buildSql() . 'a' . $key);
});
}

View File

@@ -123,7 +123,7 @@ class TopsNas extends BaseController
$model = \think\Db::table($sub_query . ' a');
foreach ($categorys as $key => $val) {
if ($key == 0) continue;
$model->union(function ($query) use ($val, $limit) {
$model->union(function ($query) use ($key, $val, $limit) {
$query->name('article')->field([
'id',
'cid',
@@ -137,6 +137,8 @@ class TopsNas extends BaseController
if (!empty($limit)) {
$query->limit($limit);
}
// 嵌套子查询解决union没有limit时排序问题
$query->table($query->buildSql() . 'a' . $key);
});
}
@@ -262,15 +264,12 @@ class TopsNas extends BaseController
// 下载
public function download()
{
$focus_image = [];
$downloads = [];
// 获取banner
$banners = $this->getBanners([129, 130]);
$banners = $this->getBanners([129]);
if (!empty($banners)) {
$focus_image = $banners['typeid_130']['banners'];
$downloads = $banners['typeid_129']['banners'];
}
$this->assign('focus_image', $focus_image);
$this->assign('downloads', $downloads);
return $this->fetch();

View File

@@ -184,7 +184,7 @@ class TopsNas extends BaseController
$model = \think\Db::table($sub_query . ' a');
foreach ($categorys as $key => $val) {
if ($key == 0) continue;
$model->union(function ($query) use ($val, $limit) {
$model->union(function ($query) use ($key, $val, $limit) {
$query->name('article')->field([
'id',
'cid',
@@ -198,6 +198,8 @@ class TopsNas extends BaseController
if (!empty($limit)) {
$query->limit($limit);
}
// 嵌套子查询解决union没有limit时排序问题
$query->table($query->buildSql() . 'a' . $key);
});
}
@@ -251,15 +253,12 @@ class TopsNas extends BaseController
public function download()
{
$focus_image = [];
$downloads = [];
// 获取banner
$banners = $this->getBanners([129, 130]);
$banners = $this->getBanners([129]);
if (!empty($banners)) {
$focus_image = $banners['typeid_130']['banners'];
$downloads = $banners['typeid_129']['banners'];
}
$this->assign('focus_image', $focus_image);
$this->assign('downloads', $downloads);
return $this->fetch();