This commit is contained in:
2026-04-25 16:55:49 +02:00
parent ae0681a016
commit 29b13ccc70
19 changed files with 248 additions and 14 deletions

View File

@@ -331,14 +331,24 @@ class GlobelusAdverts
if ( $values['keyword'] )
$filtr .= 'AND ( '
. 'title_nopl LIKE :title_nopl '
. 'OR '
. 'title LIKE :title '
. 'OR '
. 'firm_name_profile_nopl LIKE :firm_name_profile_nopl '
. 'OR '
. 'firm_name_profile LIKE :firm_name_profile '
. 'OR '
. 'text_nopl LIKE :text_nopl '
. 'OR '
. 'text LIKE :text '
. 'OR '
. 'country_nopl LIKE :country_nopl '
. 'OR '
. 'country LIKE :country '
. 'OR '
. 'city_nopl LIKE :city_nopl '
. 'OR '
. 'city LIKE :city '
. ') ';
if ( is_array( $values['countries'] ) and count( $values['countries'] ) == 1 and $values['countries'][0] == 75 )
@@ -453,7 +463,12 @@ class GlobelusAdverts
':title_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':text_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':country_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':city_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%'
':city_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':title' => '%' . trim( (string)$values['keyword'] ) . '%',
':firm_name_profile' => '%' . trim( (string)$values['keyword'] ) . '%',
':text' => '%' . trim( (string)$values['keyword'] ) . '%',
':country' => '%' . trim( (string)$values['keyword'] ) . '%',
':city' => '%' . trim( (string)$values['keyword'] ) . '%'
] ) -> fetch();
}
catch ( \Throwable $t )
@@ -493,14 +508,24 @@ class GlobelusAdverts
if ( $values['keyword'] )
$filtr .= 'AND ( '
. 'title_nopl LIKE :title_nopl '
. 'OR '
. 'title LIKE :title '
. 'OR '
. 'firm_name_profile_nopl LIKE :firm_name_profile_nopl '
. 'OR '
. 'firm_name_profile LIKE :firm_name_profile '
. 'OR '
. 'text_nopl LIKE :text_nopl '
. 'OR '
. 'text LIKE :text '
. 'OR '
. 'country_nopl LIKE :country_nopl '
. 'OR '
. 'country LIKE :country '
. 'OR '
. 'city_nopl LIKE :city_nopl '
. 'OR '
. 'city LIKE :city '
. ') ';
if ( is_array( $values['countries'] ) and count( $values['countries'] ) == 1 and $values['countries'][0] == 75 )
@@ -616,7 +641,12 @@ class GlobelusAdverts
':firm_name_profile_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':text_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':country_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
'city_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%'
':city_nopl' => '%' . \S::seo( $values['keyword'], true ) . '%',
':title' => '%' . trim( (string)$values['keyword'] ) . '%',
':firm_name_profile' => '%' . trim( (string)$values['keyword'] ) . '%',
':text' => '%' . trim( (string)$values['keyword'] ) . '%',
':country' => '%' . trim( (string)$values['keyword'] ) . '%',
':city' => '%' . trim( (string)$values['keyword'] ) . '%'
] ) -> fetchAll( \PDO::FETCH_ASSOC );
}
catch ( \Throwable $t )
@@ -654,4 +684,4 @@ class GlobelusAdverts
global $mdb;
return $mdb -> select( 'globelus_adverts_categories', [ 'id', 'name' ], [ 'ORDER' => [ 'name' => 'ASC' ] ] );
}
}
}

View File

@@ -61,21 +61,21 @@ class GlobelusCron
{
global $mdb;
$results = $mdb -> query( 'SELECT id, title FROM globelus_adverts WHERE title_nopl IS NULL' ) -> fetchAll( \PDO::FETCH_ASSOC );
$results = $mdb -> query( 'SELECT id, title FROM globelus_adverts WHERE title_nopl IS NULL OR title_nopl = \'\'' ) -> fetchAll( \PDO::FETCH_ASSOC );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$mdb -> update( 'globelus_adverts', [ 'title_nopl' => \S::seo( $row['title'], true ) ], [ 'id' => $row['id'] ] );
echo( '<p>Generuje wartość nopl - ogłoszenia.</p>' );
}
$results = $mdb -> query( 'SELECT id, firm_name_profile FROM globelus_firms_data WHERE firm_name_profile_nopl IS NULL' ) -> fetchAll( \PDO::FETCH_ASSOC );
$results = $mdb -> query( 'SELECT id, firm_name_profile FROM globelus_firms_data WHERE firm_name_profile_nopl IS NULL OR firm_name_profile_nopl = \'\'' ) -> fetchAll( \PDO::FETCH_ASSOC );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$mdb -> update( 'globelus_firms_data', [ 'firm_name_profile_nopl' => \S::seo( $row['firm_name_profile'], true ) ], [ 'id' => $row['id'] ] );
echo( '<p>Generuje wartość nopl - firmy.</p>' );
}
$results = $mdb -> query( 'SELECT id, text FROM globelus_adverts WHERE text_nopl IS NULL' ) -> fetchAll( \PDO::FETCH_ASSOC );
$results = $mdb -> query( 'SELECT id, text FROM globelus_adverts WHERE text_nopl IS NULL OR text_nopl = \'\'' ) -> fetchAll( \PDO::FETCH_ASSOC );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$mdb -> update( 'globelus_adverts', [ 'text_nopl' => \S::seo( $row['text'], true ) ], [ 'id' => $row['id'] ] );
@@ -89,7 +89,7 @@ class GlobelusCron
echo( '<p>Generuje wartość nopl - kraje.</p>' );
}
$results = $mdb -> query( 'SELECT id, city FROM globelus_adverts WHERE city_nopl IS NULL' ) -> fetchAll( \PDO::FETCH_ASSOC );
$results = $mdb -> query( 'SELECT id, city FROM globelus_adverts WHERE city_nopl IS NULL OR city_nopl = \'\'' ) -> fetchAll( \PDO::FETCH_ASSOC );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$mdb -> update( 'globelus_adverts', [ 'city_nopl' => \S::seo( $row['city'], true ) ], [ 'id' => $row['id'] ] );

View File

@@ -1083,9 +1083,9 @@ class GlobelusFirms
'outside_ue' => $values['outside_ue'],
'without_driving_license' => $values['without_driving_license'],
'aplication_link' => $aplication_link ? $aplication_link : null,
'title_nopl' => '',
'city_nopl' => '',
'text_nopl' => ''
'title_nopl' => \S::seo($values['title'], true),
'city_nopl' => \S::seo($values['city'], true),
'text_nopl' => \S::seo(\S::clear_advert_text($values['text']), true)
]);
$advert_id = $mdb->id();
}
@@ -1120,9 +1120,9 @@ class GlobelusFirms
'outside_ue' => $values['outside_ue'],
'without_driving_license' => $values['without_driving_license'],
'aplication_link' => $aplication_link ? $aplication_link : null,
'title_nopl' => '',
'city_nopl' => '',
'text_nopl' => ''
'title_nopl' => \S::seo($values['title'], true),
'city_nopl' => \S::seo($values['city'], true),
'text_nopl' => \S::seo(\S::clear_advert_text($values['text']), true)
], [
'AND' => [
'user_id' => $values['user_id'],