Compare commits
2 Commits
6865b6bea5
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f2ecd1276 | |||
| 6ef860f24f |
@@ -85,9 +85,9 @@ class BaseController extends Controller
|
|||||||
$ctrl = \think\helper\Str::snake($this->controller);
|
$ctrl = \think\helper\Str::snake($this->controller);
|
||||||
if ($ctrl == 'tops_nas') {
|
if ($ctrl == 'tops_nas') {
|
||||||
if ($this->country_code == 'US') {
|
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')) {
|
if (strpos($domain, 'orico.cc')) {
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ class TopsNas extends BaseController
|
|||||||
$model = \think\Db::table($sub_query . ' a');
|
$model = \think\Db::table($sub_query . ' a');
|
||||||
foreach ($categorys as $key => $val) {
|
foreach ($categorys as $key => $val) {
|
||||||
if ($key == 0) continue;
|
if ($key == 0) continue;
|
||||||
$model->union(function($query) use($val, $limit) {
|
$model->union(function($query) use($key, $val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -355,6 +355,8 @@ class TopsNas extends BaseController
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$query->limit($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');
|
$model = \think\Db::table($sub_query . ' a');
|
||||||
foreach ($categorys as $key => $val) {
|
foreach ($categorys as $key => $val) {
|
||||||
if ($key == 0) continue;
|
if ($key == 0) continue;
|
||||||
$model->union(function($query) use($val, $limit) {
|
$model->union(function($query) use($key, $val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -308,6 +308,8 @@ class TopsNas extends BaseController
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$query->limit($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');
|
$model = \think\Db::table($sub_query . ' a');
|
||||||
foreach ($categorys as $key => $val) {
|
foreach ($categorys as $key => $val) {
|
||||||
if ($key == 0) continue;
|
if ($key == 0) continue;
|
||||||
$model->union(function ($query) use ($val, $limit) {
|
$model->union(function ($query) use ($key, $val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -137,6 +137,8 @@ class TopsNas extends BaseController
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$query->limit($limit);
|
$query->limit($limit);
|
||||||
}
|
}
|
||||||
|
// 嵌套子查询,解决union没有limit时排序问题
|
||||||
|
$query->table($query->buildSql() . 'a' . $key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ class TopsNas extends BaseController
|
|||||||
$model = \think\Db::table($sub_query . ' a');
|
$model = \think\Db::table($sub_query . ' a');
|
||||||
foreach ($categorys as $key => $val) {
|
foreach ($categorys as $key => $val) {
|
||||||
if ($key == 0) continue;
|
if ($key == 0) continue;
|
||||||
$model->union(function ($query) use ($val, $limit) {
|
$model->union(function ($query) use ($key, $val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -198,6 +198,8 @@ class TopsNas extends BaseController
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$query->limit($limit);
|
$query->limit($limit);
|
||||||
}
|
}
|
||||||
|
// 嵌套子查询,解决union没有limit时排序问题
|
||||||
|
$query->table($query->buildSql() . 'a' . $key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user