from server 2024

This commit is contained in:
Shohrat 2024-01-10 07:30:22 +00:00
parent 4b384fafe7
commit 6c6ea2ed33
34 changed files with 798 additions and 158 deletions

View File

@ -19,6 +19,7 @@ use TPS\Birzha\Models\Notification;
use TPS\Birzha\Models\Comment; use TPS\Birzha\Models\Comment;
use TPS\Birzha\Models\Sections; use TPS\Birzha\Models\Sections;
use TPS\Birzha\Models\Category; use TPS\Birzha\Models\Category;
use TPS\Birzha\Models\Version;
use RainLab\User\Models\User; use RainLab\User\Models\User;
use ToughDeveloper\ImageResizer\Classes\Image; use ToughDeveloper\ImageResizer\Classes\Image;
@ -37,6 +38,51 @@ class BlogPostsApiController extends Controller
$this->helpers = $helpers; $this->helpers = $helpers;
} }
public function checkVersion(Request $request){
$data = $request->all();
$validator = Validator::make($data, [
'version' => 'required',
'device' => 'required'
]);
if($validator->fails()) {
return $this->helpers->apiArrayResponseBuilder(400, 'fail', $validator->errors() );
}
$update = false;
$dataq = [];
$version = Version::orderBy('id', 'DESC')->first();
if($version->version == $data["version"]){
$update = false;
$dataq = [
"current_version" => $version->version,
"need_update" => $update,
"app_url" => null
];
}elseif($version->version != $data["version"]){
$update = true;
$dataq = [
"current_version" => $version->version,
"need_update" => $update,
"app_url" => ($data["device"] == 'ios' ? $version->ios : $version->android)
];
}
return $this->helpers->apiArrayResponseBuilder(200, 'ok', [$dataq]);
}
public function onGetCategorySubs($catId){ public function onGetCategorySubs($catId){
@ -218,6 +264,14 @@ class BlogPostsApiController extends Controller
$modified = $dataq->sections[$i]->section_type::where('id', $dataq->sections[$i]->item_id)->select('id', 'name', 'email', 'username', 'shop_title', 'banner', 'is_instagram')->get(); $modified = $dataq->sections[$i]->section_type::where('id', $dataq->sections[$i]->item_id)->select('id', 'name', 'email', 'username', 'shop_title', 'banner', 'is_instagram')->get();
//$modified->makeHidden(['created_at', 'updated_at', 'deleted_at']); //$modified->makeHidden(['created_at', 'updated_at', 'deleted_at']);
$modified->map(function ($banner) use($path) {
$image = new Image($path.$banner->banner);
$banner->compressed_image = $image->resize(510)->getCachedImagePath(true);
return $banner;
});
$product_section = array( $product_section = array(
"type"=> "vendor_banner", "type"=> "vendor_banner",
"contents"=> $modified "contents"=> $modified
@ -226,12 +280,15 @@ class BlogPostsApiController extends Controller
}else if ($dataq->sections[$i]->section_type == "TPS\Birzha\Models\Product") { }else if ($dataq->sections[$i]->section_type == "TPS\Birzha\Models\Product") {
$modified = $dataq->sections[$i]->section_type::where('type', $dataq->sections[$i]->product_type)->select('id', 'name', 'price', 'description', 'place_id', 'vendor_id', 'number_of_views', 'is_home', 'short_description', 'type')->with("place")->with([ $modified = $dataq->sections[$i]->section_type::where('type', $dataq->sections[$i]->product_type)->select('id', 'name', 'price', 'description', 'place_id', 'vendor_id', 'number_of_views', 'is_home', 'short_description', 'type', 'type_order')->with("place")->with([
'translations:locale,model_id,attribute_data', 'translations:locale,model_id,attribute_data',
'images:attachment_id,attachment_type,disk_name,file_name', 'images:attachment_id,attachment_type,disk_name,file_name',
'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram,web2', 'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram,web2',
])->orderBy('ends_at', 'DESC')->limit(20)->get(); ])->orderBy('type_order', 'ASC')->limit($data->type_count)->get();
// $modified->makeHidden(['created_at', 'updated_at', 'deleted_at']); // $modified->makeHidden(['created_at', 'updated_at', 'deleted_at']);
$product_section = array( $product_section = array(
"type"=> "product_section", "type"=> "product_section",
"header" => $dataq->sections[$i]->header, "header" => $dataq->sections[$i]->header,
@ -541,16 +598,22 @@ class BlogPostsApiController extends Controller
->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'is_instagram', 'banner') ->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'is_instagram', 'banner')
->with('categories:id,name,slug,icon') ->with('categories:id,name,slug,icon')
->paginate(99); ->paginate(99);
} }
//$dataSlider["img"] = $path.$dataSlider["img"]; //$dataSlider["img"] = $path.$dataSlider["img"];
if($dataAccounts){ $dataAccounts->map(function ($banner) {
$dataAccounts->each(function ($item, $key) {
$item->logo = 'https://gurlushyk.com.tm'.Config::get('cms.storage.media.path').$item->logo; $image = new Image('https://gurlushyk.com.tm'.Config::get('cms.storage.media.path').$banner->banner);
$item->banner = 'https://gurlushyk.com.tm'.Config::get('cms.storage.media.path').$item->banner; $banner->compressed_image = $image->resize(510)->getCachedImagePath(true);
$logo = new Image('https://gurlushyk.com.tm'.Config::get('cms.storage.media.path').$banner->logo);
$banner->logo = $logo->resize(510)->getCachedImagePath(true);
return $banner;
}); });
}
return response()->json($dataAccounts, 200); return response()->json($dataAccounts, 200);
} }

View File

@ -18,6 +18,8 @@ use TPS\Birzha\Classes\ProductResource;
use DB; use DB;
use Carbon\Carbon; use Carbon\Carbon;
use ToughDeveloper\ImageResizer\Classes\Image; use ToughDeveloper\ImageResizer\Classes\Image;
use RainLab\User\Models\User;
use Illuminate\Pagination\LengthAwarePaginator;
class ProductsAPIController extends Controller class ProductsAPIController extends Controller
{ {
@ -56,16 +58,15 @@ class ProductsAPIController extends Controller
$products->map(function ($product) { $products->map(function ($product) {
$image = new Image($product->images[0]->path); $image = new Image($product->images[0]->path);
$product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true); $product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true);
$product->is_vip = $product->type == 'vip' ? (bool) true : (bool) false;
$product->calc_vip_day = $product->type == 'vip' ? $currentDate->diffInDays($product->vip_ends_at) : 'not_vip';
$product->type = $product->calc_vip_day == 0 ? '' : $product->type;
$product->type_title = $product->calc_vip_day == 0 ? '' : $product->type_title;
return $product; return $product;
}); });
// foreach($products as $product) {
/// $image = new Image($product->images[0]->path);
// $product->images[0]->path = $image->resize(200,200)->getCachedImagePath(true);
// }
// dd($products[0]->images[0]);
} catch (\Throwable $th) { } catch (\Throwable $th) {
return $this->helpers->apiArrayResponseBuilder(500, 'server error', ['message' => 'Something went wrong']); return $this->helpers->apiArrayResponseBuilder(500, 'server error', ['message' => 'Something went wrong']);
@ -74,8 +75,84 @@ class ProductsAPIController extends Controller
return response()->json($products, 200); return response()->json($products, 200);
} }
public function productsBanner(){
$main_path = 'https://gurlushyk.com.tm' . \Config::get('cms.storage.media.path');
$data = array();
// Query for products
$products = Product::with([
'translations:locale,model_id,attribute_data',
'images:attachment_id,attachment_type,disk_name,file_name',
'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram,web2',
'place',
])
->withCount(['comments as rating_avg' => function ($query) {
$query->select(DB::raw('avg(rating)'));
}])
->approved()
->orderBy('id', 'desc')
->paginate(6);
// Query for user banners
$userBanners = DB::table('users')
->select('id', 'name', 'email', 'type', 'logo', 'banner', 'shop_title', 'slogan', 'is_instagram', 'web2', 'web3')
->where('type', '!=', 'simple')
->where('banner', '!=', '')
//->orderBy('web3', 'asc')
->orderByRaw('CAST(web3 AS SIGNED) ASC')
->paginate(1);
$mergedData = collect($products->items())->merge($userBanners->items());
$paginator = new LengthAwarePaginator(
$mergedData,
$products->total() + $userBanners->total(),
$products->perPage(),
$products->currentPage(),
[
'path' => LengthAwarePaginator::resolveCurrentPath(),
'pageName' => 'page',
]
);
// Return the merged paginator
$paginator->map(function ($product) use($main_path) {
if($product->banner){
$product->content_type = 'banner';
$image = new Image($main_path.$product->banner);
$product->banner = $image->resize(500)->getCachedImagePath(true);
}else{
$product->content_type = 'product';
$image = new Image($product->images[0]->path);
$product->images[0]->compressed_image = $product->images[0]->extension == 'heic' ? $product->images[0]->path : $image->resize(300)->getCachedImagePath(true);
$product->is_vip = $product->type == 'vip' ? (bool) true : (bool) false;
$product->calc_vip_day = $product->type == 'vip' ? $currentDate->diffInDays($product->vip_ends_at) : 'not_vip';
$product->type = $product->calc_vip_day == 0 ? '' : $product->type;
$product->type_title = $product->calc_vip_day == 0 ? '' : $product->type_title;
}
//dd($product->images[0]->path);
return $product;
});
return response()->json($paginator, 200);
}
public function index(){ public function index(){
$currentDate = Carbon::now();
$currentDateFormat = $currentDate->format('Y-m-d');
//dd("sdf"); //dd("sdf");
$sortOrderParam = strtolower(input('sort_order')); $sortOrderParam = strtolower(input('sort_order'));
@ -116,11 +193,6 @@ class ProductsAPIController extends Controller
if($type){
$query = $query->where("type", $type)->orderBy('ends_at', $sortOrder);
}
if($sortPrice) { // fetch offers by the category of the product if($sortPrice) { // fetch offers by the category of the product
$query = $query->orderBy('price', $sortPrice)->orderBy('ends_at', $sortOrder); $query = $query->orderBy('price', $sortPrice)->orderBy('ends_at', $sortOrder);
@ -304,19 +376,26 @@ class ProductsAPIController extends Controller
} }
if($type){
$query->where("type", $type)->orderBy('type_order', 'ASC');
}
$data = $query ? $query->orderBy('created_at', "DESC")->orderBy('id', "DESC")->paginate($perPage) : null; $data = $query ? $query->orderBy('created_at', "DESC")->orderBy('id', "DESC")->paginate($perPage) : null;
$data->map(function ($product) { $data->map(function ($product) use($currentDate) {
$image = new Image($product->images[0]->path); $image = new Image($product->images[0]->path);
$product->images[0]->compressed_image = $image->resize(310)->getCachedImagePath(true); $product->images[0]->compressed_image = $product->images[0]->extension == 'heic' ? $product->images[0]->path : $image->resize(300)->getCachedImagePath(true);
$product->is_vip = $product->type == 'vip' ? (bool) true : (bool) false;
$product->calc_vip_day = $product->type == 'vip' ? $currentDate->diffInDays($product->vip_ends_at) : 'not_vip';
$product->type = $product->calc_vip_day == 0 ? '' : $product->type;
$product->type_title = $product->calc_vip_day == 0 ? '' : $product->type_title;
return $product; return $product;
//foreach($product->images as $compressImage){
// $image = new Image($compressImage->path);
// $compressImage->compressed_image = $image->resize([ 'quality' => 50])->getCachedImagePath(true);
//}
}); });
@ -443,6 +522,8 @@ class ProductsAPIController extends Controller
$product->stock = $data['stock']; $product->stock = $data['stock'];
$product->keyword = $product->name.', '.$product->slug;
$product->is_file_product = $data['is_file']; $product->is_file_product = $data['is_file'];
if($data['is_file'] == 1){ if($data['is_file'] == 1){
@ -843,6 +924,9 @@ class ProductsAPIController extends Controller
public function myProducts() public function myProducts()
{ {
$currentDate = Carbon::now();
$currentDateFormat = $currentDate->format('Y-m-d');
//dd("sdf"); //dd("sdf");
$perPage = intval(input('custom_per_page')); // intval protects from injection $perPage = intval(input('custom_per_page')); // intval protects from injection
@ -855,10 +939,12 @@ class ProductsAPIController extends Controller
->paginate($perPage); ->paginate($perPage);
$products->map(function ($product) { $products->map(function ($product) use($currentDate) {
$image = new Image($product->images[0]->path); $image = new Image($product->images[0]->path);
$product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true); $product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true);
$product->is_vip = $product->type == 'vip' ? (bool) true : (bool) false;
$product->calc_vip_day = $product->type == 'vip' ? $currentDate->diffInDays($product->vip_ends_at) : 'not_vip';
return $product; return $product;

View File

@ -17,10 +17,12 @@ Route::group(['prefix' =>'api/v1','namespace' =>'AhmadFatoni\ApiGenerator\Contro
Route::get('products', ['as' => 'products.index', 'uses' => 'ProductsApiController@index']); Route::get('products', ['as' => 'products.index', 'uses' => 'ProductsApiController@index']);
Route::get('products/with/banner', 'ProductsApiController@productsBanner');
Route::get('category/filters', 'CategoriesAPIController@getFilters'); Route::get('category/filters', 'CategoriesAPIController@getFilters');
Route::get('check/version', 'BlogPostsApiController@checkVersion');
Route::get('home', 'BlogPostsApiController@home'); Route::get('home', 'BlogPostsApiController@home');
// Route::get('products', 'ProductsApiController@index'); // Route::get('products', 'ProductsApiController@index');
Route::get('products/{id}', ['as' => 'products.show', 'uses' => 'ProductsApiController@show']); Route::get('products/{id}', ['as' => 'products.show', 'uses' => 'ProductsApiController@show']);

View File

@ -52,3 +52,8 @@ columns:
type: type:
label: Gornushi label: Gornushi
type: text type: text
banner:
label: Banner
type: text
searchable: true
sortable: true

View File

@ -162,6 +162,12 @@ tabs:
imageWidth: '200' imageWidth: '200'
type: mediafinder type: mediafinder
tab: Suratlar tab: Suratlar
web3:
label: 'Banner yzygiderliligi'
span: auto
default: '999'
type: number
tab: Suratlar
tiktok: tiktok:
label: TikTok label: TikTok
span: auto span: auto

View File

@ -141,9 +141,9 @@ class OfferForm extends ComponentBase
'state_id' => 'required', 'state_id' => 'required',
'stock' => 'required|', 'stock' => 'required|',
'description' => 'required', 'description' => 'required',
'new_img' => 'array|required', 'new_img' => 'array|required|max:10',
// 'is_file' => 'required', // 'is_file' => 'required',
'new_img.*' => 'mimes:jpg,png', 'new_img.*' => 'image|mimes:jpeg,jpg,png',
'category_id' => [ 'category_id' => [
'required', 'required',
'exists:tps_birzha_categories,id', 'exists:tps_birzha_categories,id',
@ -261,9 +261,9 @@ class OfferForm extends ComponentBase
'state_id' => 'required', 'state_id' => 'required',
'stock' => 'required', 'stock' => 'required',
'description' => 'required', 'description' => 'required',
'new_img' => 'array', 'new_img' => 'array|max:10',
// 'is_file' => 'required', // 'is_file' => 'required',
'new_img.*' => 'mimes:jpg,png', 'new_img.*' => 'image|mimes:jpeg,jpg,png',
'category_id' => [ 'category_id' => [
'required', 'required',
'exists:tps_birzha_categories,id', 'exists:tps_birzha_categories,id',

View File

@ -62,7 +62,7 @@ class SearchOffers extends ComponentBase
protected function loadProducts() { protected function loadProducts() {
$perPage = $this->property('perPage'); $perPage = $this->property('perPage');
$sort = \Input::get('sort'); $sort = \Input::get('sort');
$products = Product::query(); $products = Product::query()->approved();
$title = \Input::get('name'); $title = \Input::get('name');
if (isset($sort) && $sort != '') { if (isset($sort) && $sort != '') {

View File

@ -134,7 +134,7 @@ class VipProducts extends ComponentBase
$maxPrice = \Input::get('max_price'); $maxPrice = \Input::get('max_price');
$sort = \Input::get('sort'); $sort = \Input::get('sort');
$products = Product::query(); $products = Product::query()->approved();
if (isset($cSlug) && $cSlug != '') { if (isset($cSlug) && $cSlug != '') {
$category = Category::transWhere('slug', $cSlug, Session::get('rainlab.translate.locale'))->first(); $category = Category::transWhere('slug', $cSlug, Session::get('rainlab.translate.locale'))->first();

View File

@ -39,7 +39,7 @@ class Products extends Controller
$smsSender = new SmsSender(); $smsSender = new SmsSender();
$smsSender->phone = (string)'+993'.$product->vendor->username; $smsSender->phone = (string)'+993'.$product->vendor->username;
$smsSender->message = strval('Gurluşyk platformasynda, <<'.(string) $product->name.'>> tassyklandy.'); $smsSender->message = strval((string) $product->name.' tassyklandy.');
$smsSender->save(); $smsSender->save();
if($smsSender){ if($smsSender){

View File

@ -0,0 +1,18 @@
<?php namespace TPS\Birzha\Controllers;
use Backend\Classes\Controller;
use BackendMenu;
class Version extends Controller
{
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
public $listConfig = 'config_list.yaml';
public $formConfig = 'config_form.yaml';
public function __construct()
{
parent::__construct();
BackendMenu::setContext('TPS.Birzha', 'dictionary', 'side-menu-item');
}
}

View File

@ -0,0 +1,18 @@
<div data-control="toolbar">
<a href="<?= Backend::url('tps/birzha/version/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>

View File

@ -0,0 +1,10 @@
name: Version
form: $/tps/birzha/models/version/fields.yaml
modelClass: TPS\Birzha\Models\Version
defaultRedirect: tps/birzha/version
create:
redirect: 'tps/birzha/version/update/:id'
redirectClose: tps/birzha/version
update:
redirect: tps/birzha/version
redirectClose: tps/birzha/version

View File

@ -0,0 +1,12 @@
list: $/tps/birzha/models/version/columns.yaml
modelClass: TPS\Birzha\Models\Version
title: Version
noRecordsMessage: 'backend::lang.list.no_records'
showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
recordUrl: 'tps/birzha/version/update/:id'

View File

@ -0,0 +1,46 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('tps/birzha/version') ?>">Version</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<?= Form::open(['class' => 'layout']) ?>
<div class="layout-row">
<?= $this->formRender() ?>
</div>
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
data-request="onSave"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.create')) ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.create_and_close')) ?>
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('tps/birzha/version') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
</div>
</div>
<?= Form::close() ?>
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('tps/birzha/version') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<?php endif ?>

View File

@ -0,0 +1 @@
<?= $this->listRender() ?>

View File

@ -0,0 +1,22 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('tps/birzha/version') ?>">Version</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<div class="form-preview">
<?= $this->formRenderPreview() ?>
</div>
<?php else: ?>
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
<?php endif ?>
<p>
<a href="<?= Backend::url('tps/birzha/version') ?>" class="btn btn-default oc-icon-chevron-left">
<?= e(trans('backend::lang.form.return_to_list')) ?>
</a>
</p>

View File

@ -0,0 +1,54 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('tps/birzha/version') ?>">Version</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<?= Form::open(['class' => 'layout']) ?>
<div class="layout-row">
<?= $this->formRender() ?>
</div>
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
data-request="onSave"
data-request-data="redirect:0"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.save')) ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.save_and_close')) ?>
</button>
<button
type="button"
class="oc-icon-trash-o btn-icon danger pull-right"
data-request="onDelete"
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('tps/birzha/version') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
</div>
</div>
<?= Form::close() ?>
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('tps/birzha/version') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<?php endif ?>

View File

@ -0,0 +1,27 @@
<?php namespace TPS\Birzha\Models;
use Model;
/**
* Model
*/
class Version extends Model
{
use \October\Rain\Database\Traits\Validation;
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
/**
* @var string The database table used by the model.
*/
public $table = 'tps_birzha_version';
/**
* @var array Validation rules
*/
public $rules = [
];
}

View File

@ -36,6 +36,7 @@ columns:
is_file: is_file:
label: IsFile label: IsFile
type: switch type: switch
invisible: true
deleted_at: deleted_at:
label: 'POZULAN SENE' label: 'POZULAN SENE'
type: datetime type: datetime
@ -46,3 +47,13 @@ columns:
searchable: true searchable: true
invisible: false invisible: false
sortable: true sortable: true
type:
label: Gornushi
type: text
invisible: true
sortable: true
type_order:
label: 'Gornush Yzygiderlilik'
type: text
invisible: true
sortable: true

View File

@ -121,6 +121,24 @@ tabs:
type: text type: text
comment: 'site-da gorunmeli ady' comment: 'site-da gorunmeli ady'
tab: Status tab: Status
type_order:
label: 'Görnüş yzygiderliligi'
span: auto
default: '9999'
type: number
tab: Status
vip_ends_at:
label: 'Vip gutaryan sene'
span: auto
mode: date
type: datepicker
tab: Status
keyword:
label: 'Gozlenende chykmaly sozler'
span: auto
type: text
comment: 'name diyip gozledende shu harydyn chykmaly bolsa shu yerde giriz otur goyup bgidiwermeli'
tab: Status
stock: stock:
label: 'Elinizde Barmy?' label: 'Elinizde Barmy?'
options: options:
@ -131,12 +149,6 @@ tabs:
default: not_selected default: not_selected
type: balloon-selector type: balloon-selector
tab: Status tab: Status
keyword:
label: 'Gozlenende chykmaly sozler'
span: auto
type: text
comment: 'name diyip gozledende shu harydyn chykmaly bolsa shu yerde giriz otur goyup bgidiwermeli'
tab: Status
deleted_at: deleted_at:
label: 'POZULANMY?' label: 'POZULANMY?'
mode: date mode: date

View File

@ -1,4 +1,13 @@
fields: fields:
type_count:
label: 'Haryt Gornush Sany'
span: auto
default: '20'
type: number
note:
label: Note
span: auto
type: textarea
sections: sections:
label: Sections label: Sections
prompt: 'Add new item' prompt: 'Add new item'
@ -10,8 +19,8 @@ fields:
section_type: section_type:
label: Bolum label: Bolum
options: options:
TPS\Birzha\Models\SliderApp: Banner TPS\Birzha\Models\SliderApp: Slayder
RainLab\User\Models\User: 'Brend Banner' RainLab\User\Models\User: 'Ulanyjy Banner'
TPS\Birzha\Models\Product: Harytlar TPS\Birzha\Models\Product: Harytlar
showSearch: true showSearch: true
span: auto span: auto
@ -28,7 +37,3 @@ fields:
label: 'Haryt gornushi' label: 'Haryt gornushi'
span: auto span: auto
type: text type: text
note:
label: Note
span: auto
type: textarea

View File

@ -13,6 +13,10 @@ fields:
span: auto span: auto
required: 1 required: 1
type: balloon-selector type: balloon-selector
phone:
label: Telefon
span: auto
type: text
content: content:
label: Content label: Content
size: huge size: huge

View File

@ -0,0 +1,25 @@
columns:
id:
label: id
type: number
sortable: true
version:
label: version
type: text
searchable: true
sortable: true
ios:
label: ios
type: text
searchable: true
sortable: true
android:
label: android
type: text
searchable: true
sortable: true
is_update:
label: is_update
type: text
searchable: true
sortable: true

View File

@ -0,0 +1,19 @@
fields:
version:
label: 'Wersiya nomer'
span: auto
type: text
ios:
label: 'Ios URL'
size: ''
span: auto
type: textarea
android:
label: 'Android URL'
span: auto
size: ''
type: textarea
is_update:
label: 'Is update'
span: auto
type: switch

View File

@ -66,6 +66,10 @@ navigation:
icon: icon-delicious icon: icon-delicious
permissions: permissions:
- term - term
side-menu-item:
label: Version
url: tps/birzha/version
icon: icon-slack
contact-messages: contact-messages:
label: Habarlaşmak label: Habarlaşmak
url: tps/birzha/messagescontact url: tps/birzha/messagescontact

View File

@ -0,0 +1,28 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateTpsBirzhaVersion extends Migration
{
public function up()
{
Schema::create('tps_birzha_version', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->string('version');
$table->text('ios');
$table->text('android');
$table->boolean('is_update')->default(0);
});
}
public function down()
{
Schema::dropIfExists('tps_birzha_version');
}
}

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaProducts43 extends Migration
{
public function up()
{
Schema::table('tps_birzha_products', function($table)
{
$table->integer('type_order')->default(9999);
});
}
public function down()
{
Schema::table('tps_birzha_products', function($table)
{
$table->dropColumn('type_order');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaProducts44 extends Migration
{
public function up()
{
Schema::table('tps_birzha_products', function($table)
{
$table->date('vip_ends_at')->nullable();
});
}
public function down()
{
Schema::table('tps_birzha_products', function($table)
{
$table->dropColumn('vip_ends_at');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaSections extends Migration
{
public function up()
{
Schema::table('tps_birzha_sections', function($table)
{
$table->integer('type_count')->nullable()->default(20);
});
}
public function down()
{
Schema::table('tps_birzha_sections', function($table)
{
$table->dropColumn('type_count');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaTerms2 extends Migration
{
public function up()
{
Schema::table('tps_birzha_terms', function($table)
{
$table->string('phone')->nullable();
});
}
public function down()
{
Schema::table('tps_birzha_terms', function($table)
{
$table->dropColumn('phone');
});
}
}

View File

@ -0,0 +1,25 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaVersion extends Migration
{
public function up()
{
Schema::table('tps_birzha_version', function($table)
{
$table->text('ios')->default('https://apps.apple.com/us/app/gurlu%C5%9Fyk/id6468917081')->change();
$table->text('android')->default('https://play.google.com/store/apps/details?id=tm.gurlushyk.app.gurlushyk&hl=ru&gl=US')->change();
});
}
public function down()
{
Schema::table('tps_birzha_version', function($table)
{
$table->text('ios')->default(null)->change();
$table->text('android')->default(null)->change();
});
}
}

View File

@ -464,3 +464,21 @@
1.0.161: 1.0.161:
- 'Updated table tps_birzha_products' - 'Updated table tps_birzha_products'
- builder_table_update_tps_birzha_products_42.php - builder_table_update_tps_birzha_products_42.php
1.0.162:
- 'Updated table tps_birzha_terms'
- builder_table_update_tps_birzha_terms_2.php
1.0.163:
- 'Created table tps_birzha_version'
- builder_table_create_tps_birzha_version.php
1.0.164:
- 'Updated table tps_birzha_version'
- builder_table_update_tps_birzha_version.php
1.0.165:
- 'Updated table tps_birzha_products'
- builder_table_update_tps_birzha_products_43.php
1.0.166:
- 'Updated table tps_birzha_sections'
- builder_table_update_tps_birzha_sections.php
1.0.167:
- 'Updated table tps_birzha_products'
- builder_table_update_tps_birzha_products_44.php

View File

@ -88,9 +88,13 @@ items:
isExternal: '0' isExternal: '0'
- -
title: 'Mebel önümleri' title: 'Mebel önümleri'
nesting: null
type: url type: url
url: /category-profile/agac-onumleri url: /category-profile/agac-onumleri
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
ru: ru:
@ -100,23 +104,6 @@ items:
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
items: items:
-
title: Mebel
nesting: null
type: url
url: /category-profile/mebel
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
- -
title: 'Nurly Gapylar' title: 'Nurly Gapylar'
nesting: null nesting: null
@ -132,7 +119,7 @@ items:
title: '' title: ''
url: '' url: ''
isHidden: '0' isHidden: '0'
cssClass: '2' cssClass: '1'
isExternal: '0' isExternal: '0'
- -
title: 'Aýna önümleri' title: 'Aýna önümleri'
@ -221,23 +208,6 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '1' cssClass: '1'
isExternal: '0' isExternal: '0'
-
title: '3D Modeller'
nesting: null
type: url
url: /category-profile/3d-modeller
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
- -
title: 'Habarlaşmak Üçin' title: 'Habarlaşmak Üçin'
nesting: null nesting: null
@ -290,6 +260,23 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '1' cssClass: '1'
isExternal: '0' isExternal: '0'
-
title: FAWORI
nesting: null
type: url
url: category-profile/gurlusyk-harytlar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '2'
isExternal: '0'
- -
title: 'Elektrik önümleri' title: 'Elektrik önümleri'
nesting: null nesting: null
@ -342,6 +329,40 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '2' cssClass: '2'
isExternal: '0' isExternal: '0'
-
title: 'Gurluşyk harytlary'
nesting: null
type: url
url: category-profile/gurlusyk-harytlary
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '3'
isExternal: '0'
-
title: 'Rysgally metal'
nesting: null
type: url
url: category-profile/rysgally-metal
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '4'
isExternal: '0'
- -
title: Laminant title: Laminant
nesting: null nesting: null
@ -359,29 +380,12 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
-
title: Santehnikalar
nesting: null
type: url
url: /category-profile/santehnikalar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
items: items:
- -
title: BETEK title: Laminantlar
nesting: null nesting: null
type: url type: url
url: /category-profile/betek2 url: category/products/laminantlar
code: '' code: ''
reference: null reference: null
cmsPage: null cmsPage: null
@ -394,6 +398,19 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '1' cssClass: '1'
isExternal: '0' isExternal: '0'
-
title: 'Santehnika we suw üpjünçiligi'
type: url
url: /category-profile/santehnikalar
code: ''
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
- -
title: 'Demir önümleri' title: 'Demir önümleri'
nesting: null nesting: null
@ -411,29 +428,12 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
-
title: 'Suw üpjünçiligi'
nesting: null
type: url
url: /category-profile/suw-ucpjunciligi
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
items: items:
- -
title: BETEK title: 'Rysgally metal'
nesting: null nesting: null
type: url type: url
url: /category-profile/betek3 url: category-profile/demir-bazary
code: '' code: ''
reference: null reference: null
cmsPage: null cmsPage: null
@ -447,48 +447,10 @@ items:
cssClass: '1' cssClass: '1'
isExternal: '0' isExternal: '0'
- -
title: 'Birikdiriji we berkidiji' title: 'Gurluşyk harytlary'
nesting: null
type: url type: url
url: /category-profile/birikdiriji-we-berkidiji url: /category-profile/birikdiriji-we-berkidiji
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Ownuk harytlar'
nesting: null
type: url
url: /category-profile/ownuk-harytlar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'El gurallary'
nesting: null
type: url
url: /category-profile/el-gurallary
code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
ru: ru:
@ -514,4 +476,69 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
-
title: Myramorlar
type: url
url: category-profile/myramor-onumleri
code: ''
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Ýyladyjy enjamlar'
nesting: null
type: url
url: category-profile/yyladyjy-enjamlar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'THERMO HOUSE'
nesting: null
type: url
url: category-profile/thermo-house
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Ariston diller'
nesting: null
type: url
url: category-profile/ariston-diller
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '2'
isExternal: '0'
name: top-menu name: top-menu

View File

@ -81,7 +81,7 @@
<div class="row justify-content-start "> <div class="row justify-content-start ">
{% for product in products %} {% for product in products %}
<!-- Single Product --> <!-- Single Product -->
<div class="col-6 col-sm-6 col-md-2 col-lg-2"> <div class="col-6 col-sm-6 col-md-3 col-lg-2">
<div class="single-product-area mb-30"> <div class="single-product-area mb-30">
<a href="{{ 'product'|page({id: product.id}) }}"> <a href="{{ 'product'|page({id: product.id}) }}">
<div class="product_image"> <div class="product_image">