...
|
...
|
@@ -409,25 +409,26 @@ class Api |
|
|
$tidu = Db::name('product')->where(['id' => $product_id])->find();
|
|
|
if ($tidu['tidu1'] != "") {
|
|
|
if ($buy_num < $tidu['tidu1'] & $buy_num > 0) {
|
|
|
echo '1';
|
|
|
$price = $buy_num * $tidu['price'];
|
|
|
}
|
|
|
}
|
|
|
if ($tidu['tidu2'] != "") {
|
|
|
if ($buy_num > $tidu['tidu1'] - 1 & $buy_num < $tidu['tidu2']) {
|
|
|
echo '2';
|
|
|
dump($tidu['price1']);
|
|
|
dump($buy_num);
|
|
|
$price = $buy_num * $tidu['price1'];
|
|
|
dump($price);
|
|
|
}
|
|
|
}
|
|
|
die;
|
|
|
if ($tidu['tidu3'] != "") {
|
|
|
if ($buy_num > $tidu['tidu2'] - 1 & $buy_num < $tidu['tidu3']) {
|
|
|
echo '3';
|
|
|
$price = $buy_num * $tidu['price2'];
|
|
|
}
|
|
|
}
|
|
|
if ($tidu['tidu4'] != "") {
|
|
|
if ($buy_num > $tidu['tidu3'] - 1 & $buy_num < $tidu['tidu4']) {
|
|
|
echo '4';
|
|
|
$price = $buy_num * $tidu['price3'];
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -439,7 +440,6 @@ class Api |
|
|
$price = $buy_num * $tidu['price5'];
|
|
|
}
|
|
|
}
|
|
|
die;
|
|
|
$tidu_new = Db::name('product')->where(['id' => $product_id])->select();
|
|
|
foreach ($tidu_new as $k => $v) {
|
|
|
$gradient[$k]['tidu1'] = $v['tidu1'];
|
...
|
...
|
|