add price

This commit is contained in:
Andrey Kuvshinov
2020-04-07 17:39:07 +03:00
parent 3cbaef6398
commit 11e22806f5
3 changed files with 46 additions and 4 deletions

33
app/routes/price.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
function priceid_kuri($id){
$price = db_get("SELECT `pricename` FROM price WHERE `price_id` = $id");
if (is_array($price))
return $price;
}
function addhash_kuri(){
$ssql = "SELECT `price_id`, `BeginDate` FROM `price` WHERE `pricehash` = '' LIMIT 10";
$items = dbl_get($ssql);
foreach ($items as $item) {
$id = $item['price_id'];
$date = $item['BeginDate'];
$hash = md5("$id$date");
$usql = "UPDATE `price` SET `pricehash` = '$hash' WHERE `price_id` = '$id'";
dbl_get($usql, 'reader');
echo $usql."\n";
}
}