if statement - PHP IF Else Help Required


if statement - PHP IF Else Help Required

我已经疯了,我读了并尝试了我能找到的一切,我希望有人能帮助我完成…

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount'] = $reportData['profit'] = + $reportData['profit']);
else $reportData['profit'] = - $reportData['profit'];

如果退款金额大于产品成本,则应该=

目前我们只看到else

提前谢谢你谢谢罗素

我只是快速看了一下,但你应该看看W3教程中的if, else, elseif

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount']){ 
$reportData['profit'] =+ $reportData['profit'];
}
else { 
$reportData['profit'] =- $reportData['profit'];
}

我相信这就是你想要做的…

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount']){
    $reportData['profit'] =+ $reportData['profit'];
}else{ 
    $reportData['profit'] =- $reportData['profit'];
}

可能对你有帮助

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount'])
       $reportData['profit'] =+ $reportData['profit'];
 else 
    $reportData['profit'] =- $reportData['profit'];