谁打印此查询结果大于0

时间:2018-04-14 09:12:01

标签: php mysql

<?= number_format((isset($prdRow->SaleVal))?($prdRow->SaleVal / (30) * ($Logdays) 
    - ((isset ($disp10->dispamount10))?$disp10->dispamount10 - ((isset($disp1->dispamount1))?$disp1->dispamount1:0) :0) 
     - ((isset($disp2->SumOfCash))?$disp2->SumOfCash:0)
      - ((isset($prdRow->ClosingVal))?$prdRow->ClosingVal-($ret_unitsAmt):0))* ((100- $CustDiscount)/100)   
    :0,0)?> 

1 个答案:

答案 0 :(得分:0)

如果我理解你的猜测(顺便说一下,这很难),你要找的是:

<?php
$numberToDisplay = number_format((isset($prdRow->SaleVal))?($prdRow->SaleVal / (30) * ($Logdays) 
- ((isset ($disp10->dispamount10))?$disp10->dispamount10 - ((isset($disp1->dispamount1))?$disp1->dispamount1:0) :0) 
 - ((isset($disp2->SumOfCash))?$disp2->SumOfCash:0)
  - ((isset($prdRow->ClosingVal))?$prdRow->ClosingVal-($ret_unitsAmt):0))* ((100- $CustDiscount)/100)   
:0,0);

if ($numberToDisplay > 0) {
  echo $numberToDisplay;
}
?>