46 lines
652 B
PHP
46 lines
652 B
PHP
<?php
|
|
|
|
|
|
function api_pricehash($hash){
|
|
|
|
$pricesql = "
|
|
SELECT
|
|
`price_id`, `pricename`, `BeginDate`, `category_id`, `pages`
|
|
FROM
|
|
`price`
|
|
WHERE
|
|
`pricehash` = '$hash'
|
|
LIMIT 1
|
|
";
|
|
|
|
$price = db_get($pricesql);
|
|
|
|
if (!isset($price['price_id']))
|
|
return ['error' => 'not found hash'];
|
|
else
|
|
return $price;
|
|
|
|
|
|
}
|
|
|
|
|
|
function apipage_kuri($price_id, $page = 1){
|
|
|
|
|
|
$newsql = "
|
|
SELECT
|
|
news_id, title, text, img
|
|
FROM
|
|
`news`
|
|
WHERE
|
|
`price_id` = '$price_id'
|
|
AND
|
|
`page` = '$page'
|
|
|
|
";
|
|
|
|
$news = db_get($newsql);
|
|
|
|
return $news;
|
|
|
|
} |