from server

This commit is contained in:
Shohrat 2024-02-02 14:21:07 +00:00
parent 6c6ea2ed33
commit f40cf08d2d
14 changed files with 326 additions and 354 deletions

36
.env.save Normal file
View File

@ -0,0 +1,36 @@
APP_DEBUG=true
APP_URL=https://gurlushyk.com.tm
APP_KEY=HkZf470nFMajFnuvwrQqv7fsP8kFLxcz
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=gurlushyk
DB_USERNAME=root
DB_PASSWORD=bt110226**
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
DB_USE_CONFIG_FOR_TESTING=false
CACHE_DRIVER=file
JWT_TTL=527040
SESSION_DRIVER=file
QUEUE_CONNECTION=sync
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=null
MAIL_PASSWORD=null
ROUTES_CACHE=false
ASSET_CACHE=false
DATABASE_TEMPLATES=false
LINK_POLICY=detect
ENABLE_CSRF=true

View File

@ -161,7 +161,7 @@ class BlogPostsApiController extends Controller
$products->map(function ($product) {
$image = new Image($product->images[0]->path);
$product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true);
$product->images[0]->compressed_image = $image->resize(280)->getCachedImagePath(true);
return $product;
//foreach($product->images as $compressImage){
@ -511,25 +511,56 @@ class BlogPostsApiController extends Controller
public function getPlaces(Request $request)
{
$data = $request->all();
$dataq = $request->all();
//$id = $data["primary"] ?? 0;
$data = City::with([
'translations:locale,model_id,attribute_data',
])
->where('primary_key', $data["primary"] ?? 0)
->where('primary_key', $dataq["primary"] ?? 0)
->paginate(100)->toArray();
// array_unshift($data["data"], array(
// "id" => 0,
// "name" => "Ählisi",
// "order" => 0,
// ));
//dd($data);
$prim = $dataq["primary"] ?? 0;
if($prim){
$joined = (string) "0".($prim);
array_unshift($data["data"], array(
"id" => (int) $joined,
"created_at" => "2023-10-09 12:41:41",
"updated_at"=> "2023-10-09 12:41:41",
"deleted_at"=> null,
"name"=> "Ählisi",
"note"=> "",
"order"=> 1,
"primary_key"=> 3,
));
}
return response()->json($data, 200);
}
public function getPlacesForAdd(Request $request)
{
$dataq = $request->all();
//$id = $data["primary"] ?? 0;
$data = City::with([
'translations:locale,model_id,attribute_data',
])
->where('primary_key', $dataq["primary"] ?? 0)
->paginate(100)->toArray();
return response()->json($data, 200);
}
public function getSubPlaces($id)
{
$data = City::where('primary_key', $id)->get()->toArray();

View File

@ -57,7 +57,7 @@ class ProductsAPIController extends Controller
$products->map(function ($product) {
$image = new Image($product->images[0]->path);
$product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true);
$product->images[0]->compressed_image = $image->resize(280)->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;
@ -76,6 +76,13 @@ class ProductsAPIController extends Controller
}
public function productsBanner(){
$categoryId = intval(input('category_id'));
$sortPrice = input('price');
$place = input('place');
$currentDate = Carbon::now();
$currentDateFormat = $currentDate->format('Y-m-d');
$main_path = 'https://gurlushyk.com.tm' . \Config::get('cms.storage.media.path');
$data = array();
@ -86,12 +93,12 @@ class ProductsAPIController extends Controller
'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram,web2',
'place',
])
//->with('categories:id,name')
->withCount(['comments as rating_avg' => function ($query) {
$query->select(DB::raw('avg(rating)'));
}])
->approved()
->orderBy('id', 'desc')
->paginate(6);
->approved();
//->paginate(6);
// Query for user banners
$userBanners = DB::table('users')
@ -101,9 +108,101 @@ class ProductsAPIController extends Controller
//->orderBy('web3', 'asc')
->orderByRaw('CAST(web3 AS SIGNED) ASC')
->paginate(1);
if($place) { // fetch offers by the category of the product
if($place == "0".$place){
$allCity = City::where('primary_key', $place)->select("id")->get()->pluck('id')->toArray();
$products = $products->whereIn("place_id", $allCity)->orderBy('ends_at', 'desc');
}else{
$products = $products->where('place_id', $place)->orderBy('ends_at', 'desc');
}
}
if($sortPrice) { // fetch offers by the category of the product
$products = $products->orderBy('price', $sortPrice)->orderBy('ends_at', 'desc');
}
if($categoryId) { // fetch offers by the category of the product
$category = Category::find($categoryId);
if($category) {
$products = $category->products()
->with('categories:id,name')
->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();
if($place) { // fetch offers by the category of the product
$mainCity = City::where('id', $place)->first();
//dd($mainCity->id);
if($place == (string) "0".$mainCity->id){
$allCity = City::where('primary_key', $place)->select("id")->get()->pluck('id')->toArray();
$products = $products->whereIn("place_id", $allCity)->orderBy('ends_at', 'desc');
}else{
$products = $products->whereIn('place_id', $place)->orderBy('ends_at', 'desc');
}
}
if($sortPrice){
$products = $products->orderBy('price', $sortPrice)->orderBy('ends_at', 'desc');
}
} else {
$query = null;
}
}
$products = $products ? $products->orderBy('created_at', "DESC")->orderBy('id', "DESC")->paginate(6) : null;
$mergedData = collect($products->items())->merge($userBanners->items());
$contents = [];
$products->map(function ($productq) use($main_path, $currentDate) {
$productq->content_type = 'product';
$image = new Image($productq->images[0]->path);
$productq->images[0]->compressed_image = $productq->images[0]->extension == 'heic' ? $productq->images[0]->path : $image->resize(150)->getCachedImagePath(true);
$productq->is_vip = $productq->type == 'vip' ? (bool) true : (bool) false;
$productq->calc_vip_day = $productq->type == 'vip' ? $currentDate->diffInDays($productq->vip_ends_at) : 'not_vip';
$productq->type = $productq->calc_vip_day == 0 ? '' : $productq->type;
$productq->type_title = $productq->calc_vip_day == 0 ? '' : $productq->type_title;
return $productq;
});
$userBanners->map(function ($banner) use($main_path) {
$banner->content_type = 'banner';
$image = new Image($main_path.$banner->banner);
$banner->banner = $image->resize(360)->getCachedImagePath(true);
return $banner;
});
$products_collected = [["type" => "product", "contents" => $products->items()]];
$banner_collected = [["type" => "banner", "contents" => $userBanners->items()]];
$mergedData = collect($products_collected)->merge($banner_collected);
$paginator = new LengthAwarePaginator(
$mergedData,
@ -115,33 +214,11 @@ class ProductsAPIController extends Controller
'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);
@ -202,7 +279,7 @@ class ProductsAPIController extends Controller
if($place) { // fetch offers by the category of the product
if($place == (0).$place){
if($place == "0".$place){
$allCity = City::where('primary_key', $place)->select("id")->get()->pluck('id')->toArray();
@ -297,7 +374,7 @@ class ProductsAPIController extends Controller
if($place) { // fetch offers by the category of the product
if($place == (0).$place){
if($place == "0".$place){
$allCity = City::where('primary_key', $place)->select("id")->get()->pluck('id')->toArray();
@ -388,7 +465,7 @@ class ProductsAPIController extends Controller
$data->map(function ($product) use($currentDate) {
$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->images[0]->compressed_image = $product->images[0]->extension == 'heic' ? $product->images[0]->path : $image->resize(280)->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;
@ -404,6 +481,9 @@ class ProductsAPIController extends Controller
public function show($id){
$currentDate = Carbon::now();
$currentDateFormat = $currentDate->format('Y-m-d');
$product = Product::find($id);
$product->number_of_views++;
@ -412,7 +492,7 @@ class ProductsAPIController extends Controller
$data = $this->Product::with([
'translations:locale,model_id,attribute_data',
'images:id,attachment_id,attachment_type,disk_name,file_name',
'vendor:id,name,surname,email,username,logo,banner,type,web2',
'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram,web2',
'files', 'place', 'categories:id,name,slug,primary_key,icon'
])
//->withCount('comments')->withAvg('comments', 'rating')
@ -422,6 +502,11 @@ class ProductsAPIController extends Controller
->find($id);
$data->main_path = 'https://gurlushyk.com.tm' . \Config::get('cms.storage.media.path');
$data->is_vip = $data->type == 'vip' ? (bool) true : (bool) false;
$data->calc_vip_day = $data->type == 'vip' ? $currentDate->diffInDays($data->vip_ends_at) : 'not_vip';
$data->type = $data->calc_vip_day == 0 ? '' : $data->type;
$data->type_title = $data->calc_vip_day == 0 ? '' : $data->type_title;
//$data->rating_avg = number_format((float)$data->rating_avg, 1, '.', '');;
if ($data && $data->status == 'approved' /*&& $data->ends_at >= \Carbon\Carbon::now()*/){

View File

@ -44,6 +44,7 @@ Route::group(['prefix' =>'api/v1','namespace' =>'AhmadFatoni\ApiGenerator\Contro
Route::get('sliders', 'BlogPostsApiController@getSliders');
Route::get('places', 'BlogPostsApiController@getPlaces');
Route::get('places/for/add', 'BlogPostsApiController@getPlacesForAdd');
Route::get('places/{id}/subs', ['as' => 'place.subs', 'uses' => 'BlogPostsApiController@getSubPlaces']);
Route::get('accounts', 'BlogPostsApiController@getAccounts');

View File

@ -28,6 +28,7 @@ class OfferForm extends ComponentBase
*/
public $categories;
public $subcategories;
public $vipRemainingDay;
/**
* @var string A collection of countries in dropdown
@ -453,6 +454,81 @@ class OfferForm extends ComponentBase
}
}
public function onUpdateEndsAt(){
$id = Input::get('id');
$product = Product::find($id);
$currentDate = Carbon::now()->timezone('UTC +05:00');
$currentDateFormat = $currentDate->format('Y-m-d');
$user = \Auth::user();
if($product->vendor_id != $user->id) {
Flash::error(trans('Product not found'));
}
try {
if($product){
$product->created_at = $currentDateFormat;
$product->save();
}
} catch(\Throwable $e) {
Flash::error(trans('Server error'));
}
Flash::success(trans('Updated successfully'));
}
public function onUpdateStatus(){
$id = Input::get('id');
$product = Product::find($id);
$user = \Auth::user();
if($product->vendor_id != $user->id) {
Flash::error(trans('Product not found'));
}
if($product){
if($product->status == "disabled"){
$product->status = "new";
$product->save();
}else{
$product->status = "disabled";
$product->save();
}
}else{
Flash::error(trans('Product not found'));
}
Flash::success(trans('Updated successfully'));
}
public function onMakeVIP(){
$id = Input::get('id');
$product = Product::find($id);
$user = \Auth::user();
if($product->vendor_id != $user->id) {
Flash::error(trans('Product not found'));
}
if($product){
$product->type = "vip";
$product->save();
}else{
Flash::error(trans('Product not found'));
}
Flash::success(trans('Updated successfully'));
}
// after deleting a photo go the second form_step
@ -507,15 +583,20 @@ class OfferForm extends ComponentBase
}
public function onRun() {
$currentDate = Carbon::now();
$this->categories = Category::where('status',1)->where('primary_key', 0)->get();
$this->subcategories = Category::where('primary_key','>', 0)->get();
$this->states = City::where('primary_key','=', 0)->get();
$this->cities = City::where('primary_key','>', 0)->get();
$this->productIdOption = $this->property('productId');
$this->vipRemainingDay = 0;
if($this->productIdOption) {
$this->productForEditing = Product::where("vendor_id", \Auth::user()->id)->with('categories')->where("id", $this->productIdOption)->first();
$this->vipRemainingDay = $currentDate->diffInDays($this->productForEditing->vip_ends_at);
if(!$this->productForEditing){
return \Redirect::to('/');
}

View File

@ -62,7 +62,7 @@ class SearchOffers extends ComponentBase
protected function loadProducts() {
$perPage = $this->property('perPage');
$sort = \Input::get('sort');
$products = Product::query()->approved();
$products = Product::query();
$title = \Input::get('name');
if (isset($sort) && $sort != '') {
@ -72,7 +72,7 @@ class SearchOffers extends ComponentBase
$products = $products->where('keyword', 'like', '%'.$title.'%')->withCount("images");
}
$products = $products->with("vendor")->paginate($perPage);
$products = $products->where('status', 'approved')->with("vendor")->paginate($perPage);
return $products;
}

View File

@ -103,24 +103,22 @@ class UserOffers extends ComponentBase
if($categorySlug){
$category = Category::where('slug', $categorySlug)->first();
}
$products = Product::query()->approved();
$products = Product::query();
if($category){
if (isset($sort) && $sort != '') {
$sort = self::getSort($sort);
$products = $category->products()->where('vendor_id', $vendor_id)->withCount("images")->orderBy( $sort[0], $sort[1]);
$products = $category->products()->where('status', 'approved')->where('vendor_id', $vendor_id)->withCount("images")->orderBy( $sort[0], $sort[1]);
}else{
$products = $category->products()->where('vendor_id', $vendor_id)->withCount("images");
$products = $category->products()->where('status', 'approved')->where('vendor_id', $vendor_id)->withCount("images");
}
}else{
if (isset($sort) && $sort != '') {
$sort = self::getSort($sort);
$products = $products->where("vendor_id", $vendor_id)->withCount("images")->orderBy( $sort[0], $sort[1]);
$products = $products->where("vendor_id", $vendor_id)->where('status', 'approved')->withCount("images")->orderBy( $sort[0], $sort[1]);
}else{
$products = $products->where("vendor_id", $vendor_id)->withCount("images")->orderBy( "id", "DESC");
$products = $products->where("vendor_id", $vendor_id)->where('status', 'approved')->withCount("images")->orderBy( "id", "DESC");
}
}
$products = $products->paginate($perPage);
@ -130,13 +128,10 @@ class UserOffers extends ComponentBase
private static function getSort($sort): array
{
// dd($sort);
$sort_key = trim($sort, '-');
if (str_contains($sort, '-') && strpos($sort, '-') == 0) {
$sort_direction = 'desc';
}
return [
$sort_key,
$sort_direction ?? 'asc'

View File

@ -134,7 +134,7 @@ class VipProducts extends ComponentBase
$maxPrice = \Input::get('max_price');
$sort = \Input::get('sort');
$products = Product::query()->approved();
$products = Product::query();
if (isset($cSlug) && $cSlug != '') {
$category = Category::transWhere('slug', $cSlug, Session::get('rainlab.translate.locale'))->first();
@ -159,7 +159,7 @@ class VipProducts extends ComponentBase
$products = $products->orderBy( $sort[0], $sort[1]);
}
$products = $products->where("type", $type)->with('vendor')->withCount("images");
$products = $products->where("type", $type)->where('status', 'approved')->with('vendor')->withCount("images");
return $products ? $products->paginate($perPage) : null;
}

View File

@ -275,7 +275,7 @@
{% for subcategory in category.subs %}
{% if subcategory.subs.count() > 0 %}
{% for subsubcategory in subcategory.subs %}
{% for product in subsubcategory.products %}
{% for product in subsubcategory.products.where('status', 'approved') %}
<!-- Single Product -->
<div class="col-6 col-xs-6 col-sm-6 col-md-4 col-lg-4">
@ -342,7 +342,7 @@
{% else %}
{% for product in subcategory.products %}
{% for product in subcategory.products.where('status', 'approved') %}
<div class="col-6 col-xs-6 col-sm-6 col-md-4 col-lg-4">
<div class="single-product-area mb-30">
<a href="{{ 'product'|page({id: product.id}) }}">
@ -415,7 +415,7 @@
{% for subcategory in category.subs %}
{% if subcategory.subs.count() > 0 %}
{% for subsubcategory in subcategory.subs %}
{% for product in subsubcategory.products %}
{% for product in subsubcategory.products.where('status', 'approved') %}
<!-- Quick View Modal Area -->
<div class="modal fade" id="quickview{{product.id}}" tabindex="-1" role="dialog" aria-labelledby="quickview" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
@ -497,7 +497,7 @@
{% endfor %}
{% endfor %}
{% else %}
{% for product in subcategory.products %}
{% for product in subcategory.products.where('status', 'approved') %}
<div class="modal fade" id="quickview{{product.id}}" tabindex="-1" role="dialog" aria-labelledby="quickview" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">

View File

@ -65,10 +65,10 @@
<td>
{% if product.status == 'new' %}
<span class="badge badge-warning">{{ 'awaiting'|_ }}</span>
{% elseif product.status == 'disabled' %}
<span class="badge badge-danger">{{ 'disabled'|_ }}</span>
{% else %}
<span class="badge badge-success">{{ 'confirmed'|_ }}</span>
{% endif %}
</td>
<td align="center" width="25%">

View File

@ -121,6 +121,12 @@
<div class="col-4">{{ 'product.GoyulanSenesi'|_ }}:</div>
<div class="col-8">{{ product.created_at.format('d.m.Y') }}</div>
</div>
{% if product.type == 'vip' %}
<div class="row mt-2">
<div class="col-4">{{ 'product.GutaryanSenesi'|_ }}:</div>
<div class="col-8">{{ product.ends_at.format('d.m.Y') }}</div>
</div>
{% endif %}
<p>{{ product.description|raw }}</p>
</div>

View File

@ -33,24 +33,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'Bezeg Gipsler'
nesting: null
type: url
url: /category-profile/bezeg-gipsler
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Dizaýn Studiolar'
nesting: null
@ -68,24 +50,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'Bezeg Dizaýn'
nesting: null
type: url
url: /category-profile/agamyrat-dizayn
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Mebel önümleri'
nesting: null
@ -103,24 +67,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'Nurly Gapylar'
nesting: null
type: url
url: /category-profile/nurly-gapylar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Aýna önümleri'
nesting: null
@ -138,24 +84,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'Dekor Aýnalar'
nesting: null
type: url
url: /category-profile/dekor-aynalar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: Yşyklandyryş
nesting: null
@ -173,41 +101,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'VA TRADE'
nesting: null
type: url
url: /category-profile/rother-elektrik
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '2'
isExternal: '0'
-
title: 'Lux Lighting'
nesting: null
type: url
url: /category-profile/lux-lighting
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Habarlaşmak Üçin'
nesting: null
@ -242,41 +135,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: BETEK
nesting: null
type: url
url: /category-profile/betek
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
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'
nesting: null
@ -294,75 +152,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: BETEK
nesting: null
type: url
url: /category-profile/betek1
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Elektrik önümleri dükany'
nesting: null
type: url
url: /category-profile/elektrik-onumleri-dukany
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '2'
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
nesting: null
@ -380,29 +169,15 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: Laminantlar
nesting: null
type: url
url: category/products/laminantlar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Santehnika we suw üpjünçiligi'
nesting: null
type: url
url: /category-profile/santehnikalar
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
@ -428,29 +203,15 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
items:
-
title: 'Rysgally metal'
nesting: null
type: url
url: category-profile/demir-bazary
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: '1'
isExternal: '0'
-
title: 'Gurluşyk harytlary'
nesting: null
type: url
url: /category-profile/birikdiriji-we-berkidiji
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
@ -478,9 +239,13 @@ items:
isExternal: '0'
-
title: Myramorlar
nesting: null
type: url
url: category-profile/myramor-onumleri
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
@ -506,39 +271,4 @@ items:
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

View File

@ -14,6 +14,7 @@ productId = "{{ :productId }}"
{% set cities = offerform.cities %}
{% set productIdOption = offerform.productIdOption %}
{% set productForEditing = offerform.productForEditing %}
{% set vipRemainingDay = offerform.vipRemainingDay %}
@ -184,10 +185,6 @@ productId = "{{ :productId }}"
<label for="price">{{ 'productAdd.Bahasy'|_ }}</label>
<input type="number" class="form-control" id="price" name="price" min="0" value="{{ productForEditing.price }}" required>
</div>
<!-- <div class="col-md-12 mb-3">
<label for="shortDescription">{{ 'productAdd.GysgaBeyany'|_ }}</label>
<textarea class="form-control" id="shortDescription" cols="30" name="short_description" rows="10" placeholder="{{ 'productAdd.GysgaBeyany'|_ }}" style="height: 160px;" required>{{ productForEditing.short_description }}</textarea>
</div> -->
<div class="col-md-12 mb-3">
<label for="description">{{ 'productAdd.GinsileyinBeyany'|_ }}</label>
<textarea class="form-control" id="description" cols="30" rows="20" name="description" style="height: 160px;" placeholder="{{ 'productAdd.GinsileyinBeyany'|_ }}" required>{{ productForEditing.description|striptags|raw }}</textarea>
@ -196,7 +193,7 @@ productId = "{{ :productId }}"
<div class="col-md-6 mb-3">
<label for="phone">{{ 'productAdd.TelefonBelgisi2'|_ }}</label>
<span style="position:relative;top: 42px;left: -110px;font-size: 13px;">+993</span>
<input type="tel" class="form-control" id="phone" name="phone" min="61000000" max="65999999" value="{{ productForEditing.phone}}">
<input type="tel" class="form-control" style="padding-left: 52px;" id="phone" name="phone" min="61000000" max="65999999" value="{{ productForEditing.phone}}">
</div>
<div class="col-md-6 mb-3">
<label for="stock">{{ 'productAdd.SkladdaBarmy'|_ }} ?</label>
@ -253,6 +250,14 @@ productId = "{{ :productId }}"
<input type="hidden" name="product_id" value="{{ productForEditing.id }}"/>
<button type="submit" class="btn btn-primary btn-sm mt-3">{{ 'productAdd.Uytgetmek'|_ }}</button>
</form>
<a href="#" data-request="onUpdateEndsAt" data-request-data="id: {{ productForEditing.id }}" data-request-flash class="btn btn-primary btn-sm mt-3">{{ 'productAdd.WagtynyTazelemek'|_ }}</a>
<a href="#" data-request="onUpdateStatus" data-request-data="id: {{ productForEditing.id }}" data-request-flash class="btn btn-primary btn-sm mt-3">{{ 'productAdd.StatusTazelemek'|_ }}</a>
{% if productForEditing.type != 'vip' %}
<a href="#" onclick="callAdmin()" data-request="onMakeVIP" data-request-data="id: {{ productForEditing.id }}" data-request-flash class="btn btn-success btn-sm mt-3">{{ 'productAdd.VipEtmek'|_ }}</a>
{% endif %}
{% if productForEditing.type == 'vip' %}
<a href="#" class="btn btn-success btn-sm mt-3">{{ vipRemainingDay }} gün galdy</a>
{% endif %}
</div>
{% endif %}
</div>
@ -293,6 +298,11 @@ productId = "{{ :productId }}"
{% put scripts %}
<script>
function callAdmin(){
//window.open('tel:+99364004929');
window.location.href = 'tel:+99364004929';
}
function getCategories(catId) {
$.request('onGetCategorySubs', {
data: {'mainCat': catId},
@ -337,9 +347,6 @@ function getCategoriesForEdit(catId) {
</script>
<script>
$(document).ready(function() {
$("#category").on("change", function() {
var selectedValue = $(this).val();
var isFile = $(this).find(':selected').data('file');

View File

@ -5,7 +5,7 @@ function onStart(){
$type = $this->type;
$this["productsq"] = TPS\Birzha\Models\Product::where("type", $type)->with("vendor")->get();
$this["productsq"] = TPS\Birzha\Models\Product::where("type", $type)->orderBy("type_order", "ASC")->with("vendor")->get();
}
?>