Fix navigation order, server

This commit is contained in:
root 2023-07-18 10:42:18 +00:00
parent 2a21de9d7f
commit 066b323ced
4 changed files with 52 additions and 27 deletions

View File

@ -20,21 +20,26 @@ function onStart(){
[ [
"limit" => 8, "limit" => 8,
"start" => 0, "start" => 0,
] ],
[
"limit" => 1,
"start" => 5
],
], ],
[ [
[
"limit" => 0,
"start" => 1
],
[ [
"limit" => 5, "limit" => 5,
"start" => 2 "start" => 2
], ],
[ [
"limit" => 0, "limit" => 1,
"start" => 5 "start" => 1
] ],
[
"limit" => 1,
"start" => 10
],
], ],
[ [
[ [
@ -42,35 +47,33 @@ function onStart(){
"start" => 3 "start" => 3
], ],
[ [
"limit" => 4,
"start" => 8
]
],
[
[
"limit" => 2, "limit" => 2,
"start" => 4 "start" => 4
], ],
[
"limit" => 3,
"start" => 9
]
], ],
[ [
[ [
"limit" => 3, "limit" => 3,
"start" => 7 "start" => 7
], ],
[
"limit" => 3,
"start" => 9
],
],
[
[ [
"limit" => 3, "limit" => 3,
"start" => 6 "start" => 6
], ],
[ [
"limit" => 0, "limit" => 1,
"start" => 8
],
[
"limit" => 0,
"start" => 10
],
[
"limit" => 0,
"start" => 11 "start" => 11
], ],
], ],

View File

@ -41,9 +41,32 @@ function onStart(){
<div class="auto_container"> <div class="auto_container">
<div class="rest_wrap"> <div class="rest_wrap">
<div class="rest_box"> <div class="rest_box">
<div class="rest_block tabItem active" id="rest-all">
{% for shop in category.shops%} {% for shop in category.shops%}
{% partial 'home/shop_item' shop=shop %} {% partial 'home/shop_item' shop=shop %}
{% endfor %} {% endfor %}
</div>
</div>
</div>
</div>
</section>
<section class="rest page">
<div class="auto_container">
<div class="rest_wrap">
<div class="rest_box">
<div class="rest_block tabItem active" id="rest-all">
{% if id != 0%}
{% for category in top_category.categories %}
{% for shop in category.shops%}
{% partial 'home/shop_item' shop=shop %}
{% endfor %}
{% endfor %}
{% else %}
{% for shop in shops%}
{% partial 'home/shop_item' shop=shop %}
{% endfor %}
{% endif %}
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -19,7 +19,6 @@ function onStart(){
$this['shop_categories'] = Tps\Shops\Models\Category::where("top_category_id", $this->theme->main_shops)->orderBy('sort_order')->limit(3)->get(); $this['shop_categories'] = Tps\Shops\Models\Category::where("top_category_id", $this->theme->main_shops)->orderBy('sort_order')->limit(3)->get();
$this['shop_category_ids'] = $this['shop_categories']->lists('id'); $this['shop_category_ids'] = $this['shop_categories']->lists('id');
$this['shop_all'] = Tps\Shops\Models\Shop::whereIn('category_id', $this['shop_category_ids'])->limit(6)->get(); $this['shop_all'] = Tps\Shops\Models\Shop::whereIn('category_id', $this['shop_category_ids'])->limit(6)->get();
} }
?> ?>
== ==

View File

@ -1,4 +1,4 @@
title = "category" title = "main-category"
url = "/main-category/:id/:category" url = "/main-category/:id/:category"
layout = "default" layout = "default"
is_hidden = 0 is_hidden = 0