add order route

This commit is contained in:
Your Name
2021-06-19 23:26:37 +03:00
parent fe4db1b3e0
commit d328ffa7b0
9 changed files with 144 additions and 6 deletions

View File

@@ -221,6 +221,37 @@ function client_find_email_kuri($mail){
}
# узнаем id клиента по мылу или создаем его
function api_add_client($mail){
$find_mail = dbl_get("SELECT `client_id`, `clienthash` FROM `clients` WHERE `clientmail` = '$mail' LIMIT 1");
if (isset($find_mail['client_id'])){
$result = $find_mail['clienthash'];
}
else {
$add['clientmail'] = $mail;
$add['clienthash'] = md5($mail);
$add['clientdate'] = date("Y-m-d H:i:s");
$res = db_insert('clients', $add, 'chitatel');
if ($res > 0){
$result = $add['clienthash'];
}
else{
$result = false;
}
}
return $result;
}
function client_find_hash($hash){

View File

@@ -7,7 +7,7 @@ function bookid_kuri($slug) {
$query = "
SELECT
`price_id`, `pricename`, `categoryname`, `categoryslug`, price.category_id AS category_id, `BeginDate`, `priceanons`, `priceimg`, `pricehash`, `price`, `sub`
`price_id`, `pricename`, `categoryname`, `priceslug`, `categoryslug`, price.category_id AS category_id, `BeginDate`, `priceanons`, `priceimg`, `pricehash`, `price`, `offline_price`, `sub`
FROM
`price`
LEFT JOIN `pricecategory`