Add search page
This commit is contained in:
parent
11988d61ca
commit
307dee2abb
|
|
@ -42,6 +42,7 @@ class Report extends Controller
|
|||
$filenames = array_diff(scandir($storageDestinationPath), array('.', '..'));
|
||||
foreach ($filenames as $item) {
|
||||
$shop_number = explode(".", $item)[0];
|
||||
Log::info($item);
|
||||
$shop = Shop::where("shop_number", $shop_number)->get()->first();
|
||||
|
||||
if ($shop) {
|
||||
|
|
@ -51,6 +52,7 @@ class Report extends Controller
|
|||
$report_detail->report_id = $id;
|
||||
$report_detail->shop_id = $shop->id;
|
||||
// on local explode storage\app on live server storage/app
|
||||
Log::info('/extract'.explode('extract', $storageDestinationPath)[1].'/'.$item);
|
||||
$report_detail->file = '/extract'.explode('extract', $storageDestinationPath)[1].'/'.$item;
|
||||
$report_detail->save();
|
||||
Log::info("saved succesfully");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
title = "search"
|
||||
url = "/search"
|
||||
layout = "default"
|
||||
is_hidden = 0
|
||||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
|
||||
$query = '%' . input('q') . '%';
|
||||
$this['shops'] = Tps\Shops\Models\Shop::where('name', 'LIKE', $query)
|
||||
->get();
|
||||
}
|
||||
?>
|
||||
==
|
||||
<section class="crumb">
|
||||
<div class="auto_container">
|
||||
<div class="crumb_wrap">
|
||||
<div class="crumb_row">
|
||||
<a href="{{'home'|page}}" class="crumb_title">
|
||||
<span>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M1.25 12.88V6.91459C1.25 6.33752 1.51642 5.79278 1.97193 5.4385L6.85193 1.64294C7.52721 1.11773 8.47279 1.11773 9.14807 1.64294L14.0281 5.4385C14.4836 5.79278 14.75 6.33752 14.75 6.91459V12.88C14.75 13.9128 13.9128 14.75 12.88 14.75H10.75C10.4739 14.75 10.25 14.5261 10.25 14.25V11.6487C10.25 11.3855 10.207 11.1193 10.0677 10.896C9.88545 10.6039 9.64228 10.3523 9.35303 10.1595C8.95253 9.89251 8.48167 9.75 8 9.75C7.51833 9.75 7.04747 9.89251 6.64697 10.1595C6.35772 10.3523 6.11455 10.6039 5.93234 10.896C5.79305 11.1193 5.75 11.3855 5.75 11.6487V14.25C5.75 14.5261 5.52614 14.75 5.25 14.75H3.12C2.08723 14.75 1.25 13.9128 1.25 12.88Z"
|
||||
stroke="#292929" stroke-width="1.5" stroke-linecap="round"
|
||||
stroke-linejoin="round" />
|
||||
</svg>
|
||||
</span>
|
||||
Главная
|
||||
</a>
|
||||
<h4 class="crumb_title">
|
||||
Результат поиска
|
||||
</h4>
|
||||
|
||||
</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">
|
||||
{% for shop in shops%}
|
||||
{% partial 'home/shop_item' shop=shop %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -100,13 +100,13 @@ function onStart(){
|
|||
<section class="menu">
|
||||
<div class="auto_container">
|
||||
<div class="menu_wrap">
|
||||
<form action="#" class="menu_search">
|
||||
<form action="{{ 'search'|page }}" method="GET" class="menu_search">
|
||||
<h1 class="menu_search-title">
|
||||
<span>Поиск</span> по сайту
|
||||
</h1>
|
||||
|
||||
<div class="menu_search-input">
|
||||
<input type="text" placeholder="Что будем искать?">
|
||||
<input type="text" name="q" placeholder="Что будем искать?">
|
||||
</div>
|
||||
|
||||
<button class="menu_search-btn" type="submit">
|
||||
|
|
|
|||
Loading…
Reference in New Issue