add menus lk
This commit is contained in:
@@ -3,10 +3,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function bookid_kuri($hash) {
|
||||
|
||||
$query = "SELECT `price_id`, `pricename`, `BeginDate`, `priceanons`, `priceimg`, `pricehash` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1";
|
||||
$query = "SELECT `price_id`, `pricename`, `BeginDate`, `priceanons`, `priceimg`, `pricehash`, `price` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1";
|
||||
|
||||
$book = dbl_get($query);
|
||||
|
||||
@@ -21,6 +20,47 @@ function bookid_kuri($hash) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* вернуть товары магазина (все или по фильтру)
|
||||
*/
|
||||
function api_books_kuri($category = 'all', $page = 1){
|
||||
|
||||
$limit = 25;
|
||||
|
||||
if ($page > 1){
|
||||
$offset = $limit * ($page - 1);
|
||||
$offset_str = ", $offset";
|
||||
}
|
||||
else {
|
||||
$offset_str = '';
|
||||
}
|
||||
|
||||
if ($category == 'all'){
|
||||
$where = '';
|
||||
}
|
||||
else {
|
||||
|
||||
$category_sql = "SELECT `category_id` FROM `pricecategory` WHERE `categoryslug` = '$category' LIMIT 1";
|
||||
|
||||
$category = db_get($category_sql);
|
||||
|
||||
if (isset($category['category_id'])) {
|
||||
$category_id = $category['category_id'];
|
||||
$where = "WHERE `category_id` = $category_id";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$sql_books = "SELECT * FROM `price` $where ORDER BY `price_id` DESC LIMIT $limit $offset_str";
|
||||
|
||||
return db_get($sql_books);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user