Exemplo n.º 1
0
        $parameter_id = M('action')->where("page_id='" . $val['id'] . "' AND action_key='parameter'")->getField('action_value');
        if ($parameter_id) {
            ?>
							<?php 
            $parameter = unserialize(mc_get_meta($val['page_id'], 'parameter'));
            ?>
							<?php 
            echo $parameter[$parameter_id]['name'];
            ?>
							<?php 
        }
        ?>
						</th>
						<th class="th3">
							<div class="mt-10"><?php 
        echo mc_cart_price($val['id']);
        ?>
 元</div>
						</th>
						<th class="th4">
							<div class="input-group input-group-sm mt-10">
								<a href="<?php 
        echo U('home/perform/cart_number?id=' . $val['id'] . '&number=1&for=1');
        ?>
" class="input-group-addon">
									<i class="glyphicon glyphicon-minus-sign"></i>
								</a>
								<span class="value"><?php 
        echo $val['action_value'];
        ?>
</span>
Exemplo n.º 2
0
function mc_total($id = false)
{
    if ($id) {
        $user_id = $id;
    } else {
        $user_id = mc_user_id();
    }
    $cart = M('action')->where("user_id='{$user_id}' AND action_key='cart'")->select();
    foreach ($cart as $val) {
        $price = mc_cart_price($val['id']);
        $number = $val['action_value'];
        $t = $price * $number;
        $total += $t;
    }
    if (mc_option('yunfei') > 0) {
        $total = $total + mc_option('yunfei');
    }
    return $total;
}