作者 王智

222

@@ -409,25 +409,26 @@ class Api @@ -409,25 +409,26 @@ class Api
409 $tidu = Db::name('product')->where(['id' => $product_id])->find(); 409 $tidu = Db::name('product')->where(['id' => $product_id])->find();
410 if ($tidu['tidu1'] != "") { 410 if ($tidu['tidu1'] != "") {
411 if ($buy_num < $tidu['tidu1'] & $buy_num > 0) { 411 if ($buy_num < $tidu['tidu1'] & $buy_num > 0) {
412 - echo '1';  
413 $price = $buy_num * $tidu['price']; 412 $price = $buy_num * $tidu['price'];
414 } 413 }
415 } 414 }
416 if ($tidu['tidu2'] != "") { 415 if ($tidu['tidu2'] != "") {
417 if ($buy_num > $tidu['tidu1'] - 1 & $buy_num < $tidu['tidu2']) { 416 if ($buy_num > $tidu['tidu1'] - 1 & $buy_num < $tidu['tidu2']) {
418 echo '2'; 417 echo '2';
  418 + dump($tidu['price1']);
  419 + dump($buy_num);
419 $price = $buy_num * $tidu['price1']; 420 $price = $buy_num * $tidu['price1'];
  421 + dump($price);
420 } 422 }
421 } 423 }
  424 + die;
422 if ($tidu['tidu3'] != "") { 425 if ($tidu['tidu3'] != "") {
423 if ($buy_num > $tidu['tidu2'] - 1 & $buy_num < $tidu['tidu3']) { 426 if ($buy_num > $tidu['tidu2'] - 1 & $buy_num < $tidu['tidu3']) {
424 - echo '3';  
425 $price = $buy_num * $tidu['price2']; 427 $price = $buy_num * $tidu['price2'];
426 } 428 }
427 } 429 }
428 if ($tidu['tidu4'] != "") { 430 if ($tidu['tidu4'] != "") {
429 if ($buy_num > $tidu['tidu3'] - 1 & $buy_num < $tidu['tidu4']) { 431 if ($buy_num > $tidu['tidu3'] - 1 & $buy_num < $tidu['tidu4']) {
430 - echo '4';  
431 $price = $buy_num * $tidu['price3']; 432 $price = $buy_num * $tidu['price3'];
432 } 433 }
433 } 434 }
@@ -439,7 +440,6 @@ class Api @@ -439,7 +440,6 @@ class Api
439 $price = $buy_num * $tidu['price5']; 440 $price = $buy_num * $tidu['price5'];
440 } 441 }
441 } 442 }
442 - die;  
443 $tidu_new = Db::name('product')->where(['id' => $product_id])->select(); 443 $tidu_new = Db::name('product')->where(['id' => $product_id])->select();
444 foreach ($tidu_new as $k => $v) { 444 foreach ($tidu_new as $k => $v) {
445 $gradient[$k]['tidu1'] = $v['tidu1']; 445 $gradient[$k]['tidu1'] = $v['tidu1'];