ver. 0.277: ShopProduct factory, Dashboard, Update migration, legacy cleanup, admin\App
- ShopProduct factory: full migration (~40 ProductRepository methods, ~30 controller actions) - Dashboard: Domain+DI migration (DashboardRepository + DashboardController) - Update: Domain+DI migration (UpdateRepository + UpdateController, template rewrite) - Renamed admin\Site to admin\App, removed dead fallback routing - Removed all legacy folders: admin/controls, admin/factory, admin/view - Newsletter: switched from admin\factory\Articles to ArticleRepository - 414 tests, 1335 assertions passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -840,4 +840,28 @@ class ArticleRepository
|
||||
|
||||
$this->db->delete('pp_articles_images', ['article_id' => null]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera artykuly opublikowane w podanym zakresie dat.
|
||||
*/
|
||||
public function articlesByDateAdd( string $dateStart, string $dateEnd ): array
|
||||
{
|
||||
$stmt = $this->db->query(
|
||||
'SELECT id FROM pp_articles '
|
||||
. 'WHERE status = 1 '
|
||||
. 'AND date_add BETWEEN \'' . addslashes( $dateStart ) . '\' AND \'' . addslashes( $dateEnd ) . '\' '
|
||||
. 'ORDER BY date_add DESC'
|
||||
);
|
||||
|
||||
$articles = [];
|
||||
$rows = $stmt ? $stmt->fetchAll( \PDO::FETCH_ASSOC ) : [];
|
||||
|
||||
if ( is_array( $rows ) ) {
|
||||
foreach ( $rows as $row ) {
|
||||
$articles[] = \front\factory\Articles::article_details( $row['id'], 'pl' );
|
||||
}
|
||||
}
|
||||
|
||||
return $articles;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user