Compare commits
3 Commits
5b700434b8
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f2ecd1276 | |||
| 6ef860f24f | |||
| 42b2242570 |
@@ -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')) {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,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',
|
||||
@@ -308,6 +308,8 @@ class TopsNas extends BaseController
|
||||
if (!empty($limit)) {
|
||||
$query->limit($limit);
|
||||
}
|
||||
// 嵌套子查询,解决union没有limit时排序问题
|
||||
$query->table($query->buildSql() . 'a' . $key);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user