Compare commits
14 Commits
dev
...
6865b6bea5
| Author | SHA1 | Date | |
|---|---|---|---|
| 6865b6bea5 | |||
| 5b700434b8 | |||
| 47d7832c12 | |||
| ba4a2211c6 | |||
| ec7ee48be8 | |||
| ed58ffa3d6 | |||
| e993caaa2c | |||
| 9df93a243f | |||
| 2de1aad5c6 | |||
| cca4eddbe8 | |||
| e1d8b67001 | |||
| f558dcf478 | |||
| 6df8d23686 | |||
| cadb9dbcc4 |
@@ -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", $this->request->param()));
|
return $this->redirect(url("@usmobile/$ctrl/$action"));
|
||||||
}
|
}
|
||||||
return $this->redirect(url("@mobile/$ctrl/$action", $this->request->param()));
|
return $this->redirect(url("@mobile/$ctrl/$action"));
|
||||||
}
|
}
|
||||||
|
|
||||||
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($key, $val, $limit) {
|
$model->union(function($query) use($val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -355,8 +355,6 @@ class TopsNas extends BaseController
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$query->limit($limit);
|
$query->limit($limit);
|
||||||
}
|
}
|
||||||
// 嵌套子查询,解决union没有limit时排序问题
|
|
||||||
$query->table($query->buildSql() . 'a' . $key);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,6 @@ class TopsNas extends BaseController
|
|||||||
|
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据分类获取文章
|
// 根据分类获取文章
|
||||||
private function getArticleByCategory($categorys, $limit = null)
|
private function getArticleByCategory($categorys, $limit = null)
|
||||||
{
|
{
|
||||||
@@ -294,7 +293,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($key, $val, $limit) {
|
$model->union(function($query) use($val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -308,8 +307,6 @@ class TopsNas extends BaseController
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$query->limit($limit);
|
$query->limit($limit);
|
||||||
}
|
}
|
||||||
// 嵌套子查询,解决union没有limit时排序问题
|
|
||||||
$query->table($query->buildSql() . 'a' . $key);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
0
app/mobile/view/tops_nas/helper.phtml
Normal file → Executable file
0
app/mobile/view/tops_nas/helper.phtml
Normal file → Executable file
0
app/mobile/view/tops_nas/helper_detail.phtml
Normal file → Executable file
0
app/mobile/view/tops_nas/helper_detail.phtml
Normal file → Executable file
@@ -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 ($key, $val, $limit) {
|
$model->union(function ($query) use ($val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -137,8 +137,6 @@ 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 ($key, $val, $limit) {
|
$model->union(function ($query) use ($val, $limit) {
|
||||||
$query->name('article')->field([
|
$query->name('article')->field([
|
||||||
'id',
|
'id',
|
||||||
'cid',
|
'cid',
|
||||||
@@ -198,8 +198,6 @@ 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