请问这段代码 怎么让它实现判断金额是不是大于39

qq123570719 2015-05-29 05:36:00
<tr class="order-total">
<td class="deal-buy-desc"><strong>应付总额:</strong></td>
<td class="deal-buy-quantity"></td>
<td class="deal-buy-multi"></td>
<td class="deal-buy-price"></td>
<td class="deal-buy-equal">=</td>
<td class="deal-buy-total"><span class="money">{$currency}</span>{$order['origin']}</td>
</tr>

》》》》》》》》》》》》
{$order['origin']}是订单金额 如果大于39 就无邮费
如果小于39 就总金额 {$order['origin']} 再加上3元运费

另外的代码是这些
<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');
require_once(dirname(__FILE__) . '/paybank.php');
$id = intval($_GET['id']);
$order = Table::Fetch('order', $id);
if (!$order) {
Session::Set('error', '订单不存在');
redirect( WEB_ROOT . '/index.php' );
}
if ( $order['user_id'] != $login_user['id']) {
redirect( WEB_ROOT . "/team.php?id={$order['team_id']}");
}
$team = Table::Fetch('team', $order['team_id']);
$team['state'] = team_state($team);
if ( $team['close_time'] ) {
redirect( WEB_ROOT . "/team.php?id={$id}");
}

//如果购物车有多件商品
if(is_user_edit() == true){
$condition = array(
"packageid = $id or id = $id",
);
$order_list = DB::LimitQuery('order', array(
'condition' => $condition,
));
}
$team_num = count($order_list);
function get_team_title($id){
$team = Table::Fetch('team', $id);
return $team['title'];
}


if ( $order['state'] == 'unpay' ) {

/* payservice choice */
if(@$INI[$order['service']]['mid'] || @$INI[$order['service']]['acc']) {
$ordercheck[$order['service']] = 'checked';
}
else {
foreach($payservice AS $pone) {
if(@$INI[$order['service']]['mid'] || @$INI[$order['service']]['acc']) { $ordercheck[$order['service']] = 'checked'; }
}
}
$credityes = ($login_user['money'] >= $order['origin']);
$creditonly = ($team['team_type'] == 'seconds' && option_yes('creditseconds'));

/* generator unique pay_id */
if (! ($order['pay_id']
&& (preg_match('#-(\d+)-(\d+)-#', $order['pay_id'], $m)
&& ( $m[1] == $order['id'] && $m[2] == $order['quantity']) )
)) {
$randid = strtolower(Utility::GenSecret(4, Utility::CHAR_WORD));
$pay_id = "go-{$order['id']}-{$order['quantity']}-{$randid}";
Table::UpdateCache('order', $order['id'], array(
'pay_id' => $pay_id,
));
}
die(include template('order_check'));
}
redirect( WEB_ROOT . "/order/view.php?id={$id}");
...全文
311 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
果酱很好吃 2015-05-29
  • 打赏
  • 举报
回复
.... if (!$order) { Session::Set('error', '订单不存在'); redirect( WEB_ROOT . '/index.php' ); } $order['origin'] = $order['origin'] > 39 ? $order['origin'] : ($order['origin']+3); ....

21,888

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧