本文整理匯總了PHP中ncPriceFormat函數的典型用法代碼示例。如果您正苦於以下問題:PHP ncPriceFormat函數的具體用法?PHP ncPriceFormat怎麽用?PHP ncPriceFormat使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ncPriceFormat函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getVrOrderInfo
/**
* 取得虛擬訂單所需支付金額等信息
* @param int $order_sn
* @param int $member_id
* @return array
*/
public function getVrOrderInfo($order_sn, $member_id = null)
{
//驗證訂單信息
$model_order = Model('vr_order');
$condition = array();
$condition['order_sn'] = $order_sn;
if (!empty($member_id)) {
$condition['buyer_id'] = $member_id;
}
$order_info = $model_order->getOrderInfo($condition);
if (empty($order_info)) {
return callback(false, '該訂單不存在');
}
$order_info['subject'] = '虛擬訂單_' . $order_sn;
$order_info['order_type'] = 'vr_order';
$order_info['pay_sn'] = $order_sn;
//計算所需要支付金額(支付卡+餘額支付了)//zmr>v60
$payed_amount = floatval($order_info['rcb_amount']) + floatval($order_info['pd_amount']);
$pay_amount += ncPriceFormat(floatval($order_info['order_amount']) - $payed_amount);
//zmr<v60
//計算本次需要在線支付的訂單總金額
//$pay_amount = ncPriceFormat(floatval($order_info['order_amount']) - floatval($order_info['pd_amount']));
$order_info['api_pay_amount'] = $pay_amount;
return callback(true, '', $order_info);
}
示例2: getBuyStepData
/**
* 得到虛擬商品購買數據(商品、店鋪、會員)
* @param int $goods_id 商品ID
* @param int $quantity 購買數量
* @param int $member_id 會員ID
* @return array
*/
public function getBuyStepData($goods_id, $quantity, $member_id)
{
$goods_info = Model('goods')->getVirtualGoodsOnlineInfoByID($goods_id);
if (empty($goods_info)) {
return callback(false, '該商品不符合購買條件,可能的原因有:下架、不存在、過期等');
}
if ($goods_info['virtual_limit'] > $goods_info['goods_storage']) {
$goods_info['virtual_limit'] = $goods_info['goods_storage'];
}
//取得搶購信息
$goods_info = $this->_getGroupbuyInfo($goods_info);
$quantity = abs(intval($quantity));
$quantity = $quantity == 0 ? 1 : $quantity;
$quantity = $quantity > $goods_info['virtual_limit'] ? $goods_info['virtual_limit'] : $quantity;
if ($quantity > $goods_info['goods_storage']) {
return callback(false, '該商品庫存不足');
}
$goods_info['quantity'] = $quantity;
$goods_info['goods_total'] = ncPriceFormat($goods_info['goods_price'] * $goods_info['quantity']);
$goods_info['goods_image_url'] = cthumb($goods_info['goods_image'], 240, $goods_info['store_id']);
$return = array();
$return['goods_info'] = $goods_info;
$return['store_info'] = Model('store')->getStoreOnlineInfoByID($goods_info['store_id'], 'store_name,store_id,member_id');
$return['member_info'] = Model('member')->getMemberInfoByID($member_id);
// $model_payment = Model('payment');
// $pd_payment_info = Model('payment')->getPaymentOpenInfo(array('payment_code'=>'predeposit'));
// if (empty($pd_payment_info)) {
// $return['member_info']['available_predeposit'] = 0;
// $return['member_info']['available_rc_balance'] = 0;
// }
return callback(true, '', $return);
}
示例3: add_refundOp
/**
* 添加兌換碼退款
*
*/
public function add_refundOp()
{
$model_vr_refund = Model('vr_refund');
$order_id = intval($_GET['order_id']);
if ($order_id < 1) {
//參數驗證
showDialog(Language::get('wrong_argument'), 'index.php?act=member_vr_refund&op=index', 'error');
}
$condition = array();
$condition['buyer_id'] = $_SESSION['member_id'];
$condition['order_id'] = $order_id;
$order = $model_vr_refund->getRightOrderList($condition);
$order_id = $order['order_id'];
if (!$order['if_refund']) {
//檢查狀態,防止頁麵刷新不及時造成數據錯誤
showDialog(Language::get('wrong_argument'), 'index.php?act=member_vr_order&op=index', 'error');
}
if (chksubmit() && $order['if_refund']) {
$code_list = $order['code_list'];
$refund_array = array();
$goods_num = 0;
//兌換碼數量
$refund_amount = 0;
//退款金額
$code_sn = '';
$rec_id_array = $_POST['rec_id'];
if (!empty($rec_id_array) && is_array($rec_id_array)) {
//選擇退款的兌換碼
foreach ($rec_id_array as $key => $value) {
$code = $code_list[$value];
if (!empty($code)) {
$goods_num += 1;
$refund_amount += $code['pay_price'];
//實際支付金額
$code_sn .= $code['vr_code'] . ',';
//兌換碼編號
}
}
}
if ($goods_num < 1) {
showDialog(Language::get('wrong_argument'), 'reload', 'error');
}
$refund_array['code_sn'] = rtrim($code_sn, ',');
$refund_array['admin_state'] = '1';
//狀態:1為待審核,2為同意,3為不同意
$refund_array['refund_amount'] = ncPriceFormat($refund_amount);
$refund_array['goods_num'] = $goods_num;
$refund_array['buyer_message'] = $_POST['buyer_message'];
$refund_array['add_time'] = time();
$state = $model_vr_refund->addRefund($refund_array, $order);
if ($state) {
showDialog(Language::get('nc_common_save_succ'), 'index.php?act=member_vr_refund&op=index', 'succ');
} else {
showDialog(Language::get('nc_common_save_fail'), 'reload', 'error');
}
}
Tpl::showpage('member_vr_refund_add');
}
示例4: order_ship_priceOp
/**
* 修改運費
*/
public function order_ship_priceOp()
{
$order_id = intval($_POST['order_id']);
$shipping_fee = ncPriceFormat($_POST['shipping_fee']);
$model_order = Model('order');
$condition = array();
$condition['order_id'] = $order_id;
$condition['store_id'] = $this->store_info['store_id'];
$order_info = $model_order->getOrderInfo($condition);
$if_allow = $model_order->getOrderOperateState('modify_price', $order_info);
if (!$if_allow) {
output_error('無權操作');
}
$result = Logic('order')->changeOrderShipPrice($order_info, 'seller', $this->seller_info['seller_name'], $shipping_fee);
if (!$result['state']) {
output_error($result['msg']);
}
output_data('1');
}
示例5: getVrOrderInfo
/**
* 取得虛擬訂單所需支付金額等信息
* @param int $order_sn
* @param int $member_id
* @return array
*/
public function getVrOrderInfo($order_sn, $member_id = null)
{
//驗證訂單信息
$model_order = Model('vr_order');
$condition = array();
$condition['order_sn'] = $order_sn;
if (!empty($member_id)) {
$condition['buyer_id'] = $member_id;
}
$order_info = $model_order->getOrderInfo($condition);
if (empty($order_info)) {
return callback(false, '該訂單不存在');
}
$order_info['subject'] = '虛擬訂單_' . $order_sn;
$order_info['order_type'] = 'vr_order';
$order_info['pay_sn'] = $order_sn;
//計算本次需要在線支付的訂單總金額
//$pay_amount = ncPriceFormat(floatval($order_info['order_amount']) - floatval($order_info['pd_amount']));
//修複 第三方支付時 充值卡沒算在內BUG 33 hao .com 好 商城V3
$pay_amount = ncPriceFormat(floatval($order_info['order_amount']) - floatval($order_info['pd_amount']) - floatval($order_info['rcb_amount']));
$order_info['api_pay_amount'] = $pay_amount;
return callback(true, '', $order_info);
}
示例6: ncPriceFormat
?>
/images/loading.gif" data-src="<?php
echo $image_url;
?>
" title="<?php
echo $value['commend_goods_name'];
?>
" alt="<?php
echo $value['commend_goods_name'];
?>
" /> </a>
<div class="price"> <?php
echo $lang['currency'];
?>
<strong><?php
echo ncPriceFormat($value['commend_goods_price']);
?>
</strong></div>
</div>
<div class="handle">
<span class="like-btn"><a nc_type="microshop_like" like_id="<?php
echo $value['commend_id'];
?>
" href="javascript:void(0)"><i class="pngFix"></i><span><?php
echo $lang['microshop_text_like'];
?>
</span><em><?php
echo $value['like_count'] <= 999 ? $value['like_count'] : '999+';
?>
</em></a></span>
示例7: changePd
//.........這裏部分代碼省略.........
$data_pd['available_predeposit'] = array('exp', 'available_predeposit-' . $data['amount']);
$data_msg['av_amount'] = -$data['amount'];
$data_msg['freeze_amount'] = $data['amount'];
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'order_cancel':
$data_log['lg_av_amount'] = $data['amount'];
$data_log['lg_freeze_amount'] = -$data['amount'];
$data_log['lg_desc'] = '取消訂單,解凍預存款,訂單號: ' . $data['order_sn'];
$data_pd['freeze_predeposit'] = array('exp', 'freeze_predeposit-' . $data['amount']);
$data_pd['available_predeposit'] = array('exp', 'available_predeposit+' . $data['amount']);
$data_msg['av_amount'] = $data['amount'];
$data_msg['freeze_amount'] = -$data['amount'];
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'order_comb_pay':
$data_log['lg_freeze_amount'] = -$data['amount'];
$data_log['lg_desc'] = '下單,支付被凍結的預存款,訂單號: ' . $data['order_sn'];
$data_pd['freeze_predeposit'] = array('exp', 'freeze_predeposit-' . $data['amount']);
$data_msg['av_amount'] = 0;
$data_msg['freeze_amount'] = $data['amount'];
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'recharge':
$data_log['lg_av_amount'] = $data['amount'];
$data_log['lg_desc'] = '充值,充值單號: ' . $data['pdr_sn'];
$data_log['lg_admin_name'] = $data['admin_name'];
$data_pd['available_predeposit'] = array('exp', 'available_predeposit+' . $data['amount']);
$data_msg['av_amount'] = $data['amount'];
$data_msg['freeze_amount'] = 0;
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'refund':
$data_log['lg_av_amount'] = $data['amount'];
$data_log['lg_desc'] = '確認退款,訂單號: ' . $data['order_sn'];
$data_pd['available_predeposit'] = array('exp', 'available_predeposit+' . $data['amount']);
$data_msg['av_amount'] = $data['amount'];
$data_msg['freeze_amount'] = 0;
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'vr_refund':
$data_log['lg_av_amount'] = $data['amount'];
$data_log['lg_desc'] = '虛擬兌碼退款成功,訂單號: ' . $data['order_sn'];
$data_pd['available_predeposit'] = array('exp', 'available_predeposit+' . $data['amount']);
$data_msg['av_amount'] = $data['amount'];
$data_msg['freeze_amount'] = 0;
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'cash_apply':
$data_log['lg_av_amount'] = -$data['amount'];
$data_log['lg_freeze_amount'] = $data['amount'];
$data_log['lg_desc'] = '申請提現,凍結預存款,提現單號: ' . $data['order_sn'];
$data_pd['available_predeposit'] = array('exp', 'available_predeposit-' . $data['amount']);
$data_pd['freeze_predeposit'] = array('exp', 'freeze_predeposit+' . $data['amount']);
$data_msg['av_amount'] = -$data['amount'];
$data_msg['freeze_amount'] = $data['amount'];
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'cash_pay':
$data_log['lg_freeze_amount'] = -$data['amount'];
$data_log['lg_desc'] = '提現成功,提現單號: ' . $data['order_sn'];
$data_log['lg_admin_name'] = $data['admin_name'];
$data_pd['freeze_predeposit'] = array('exp', 'freeze_predeposit-' . $data['amount']);
$data_msg['av_amount'] = 0;
$data_msg['freeze_amount'] = -$data['amount'];
$data_msg['desc'] = $data_log['lg_desc'];
break;
case 'cash_del':
$data_log['lg_av_amount'] = $data['amount'];
$data_log['lg_freeze_amount'] = -$data['amount'];
$data_log['lg_desc'] = '取消提現申請,解凍預存款,提現單號: ' . $data['order_sn'];
$data_log['lg_admin_name'] = $data['admin_name'];
$data_pd['available_predeposit'] = array('exp', 'available_predeposit+' . $data['amount']);
$data_pd['freeze_predeposit'] = array('exp', 'freeze_predeposit-' . $data['amount']);
$data_msg['av_amount'] = $data['amount'];
$data_msg['freeze_amount'] = -$data['amount'];
$data_msg['desc'] = $data_log['lg_desc'];
break;
default:
throw new Exception('參數錯誤');
break;
}
$update = Model('member')->editMember(array('member_id' => $data['member_id']), $data_pd);
if (!$update) {
throw new Exception('操作失敗');
}
$insert = $this->table('pd_log')->insert($data_log);
if (!$insert) {
throw new Exception('操作失敗');
}
// 支付成功發送買家消息
$param = array();
$param['code'] = 'predeposit_change';
$param['member_id'] = $data['member_id'];
$data_msg['av_amount'] = ncPriceFormat($data_msg['av_amount']);
$data_msg['freeze_amount'] = ncPriceFormat($data_msg['freeze_amount']);
$param['param'] = $data_msg;
QueueClient::push('sendMemberMsg', $param);
return $insert;
}
示例8: _getBundlingCartList
/**
* 取得購買車內組合銷售信息以及包含的商品及有效狀態
* @param array $cart_list
*/
private function _getBundlingCartList(&$cart_list)
{
if (!C('promotion_allow') || empty($cart_list)) {
return;
}
$model_bl = Model('p_bundling');
$model_goods = Model('goods');
foreach ($cart_list as $key => $cart_info) {
if (!intval($cart_info['bl_id'])) {
continue;
}
$cart_list[$key]['state'] = true;
$cart_list[$key]['storage_state'] = true;
$bl_info = $model_bl->getBundlingInfo(array('bl_id' => $cart_info['bl_id']));
//標誌優惠套裝是否處於有效狀態
if (empty($bl_info) || !intval($bl_info['bl_state'])) {
$cart_list[$key]['state'] = false;
}
//取得優惠套裝商品列表
$cart_list[$key]['bl_goods_list'] = $model_bl->getBundlingGoodsList(array('bl_id' => $cart_info['bl_id']));
//取最新在售商品信息
$goods_id_array = array();
foreach ($cart_list[$key]['bl_goods_list'] as $goods_info) {
$goods_id_array[] = $goods_info['goods_id'];
}
$goods_list = $model_goods->getGoodsOnlineListAndPromotionByIdArray($goods_id_array);
$goods_online_list = array();
foreach ($goods_list as $goods_info) {
$goods_online_list[$goods_info['goods_id']] = $goods_info;
}
unset($goods_list);
//使用最新的商品名稱、圖片,如果一旦有商品下架,則整個套裝置置為無效狀態
$total_down_price = 0;
foreach ($cart_list[$key]['bl_goods_list'] as $k => $goods_info) {
if (array_key_exists($goods_info['goods_id'], $goods_online_list)) {
$goods_online_info = $goods_online_list[$goods_info['goods_id']];
//如果庫存不足,標識false
if ($cart_info['goods_num'] > $goods_online_info['goods_storage']) {
$cart_list[$key]['storage_state'] = false;
}
$cart_list[$key]['bl_goods_list'][$k]['goods_id'] = $goods_online_info['goods_id'];
$cart_list[$key]['bl_goods_list'][$k]['goods_commonid'] = $goods_online_info['goods_commonid'];
$cart_list[$key]['bl_goods_list'][$k]['store_id'] = $goods_online_info['store_id'];
$cart_list[$key]['bl_goods_list'][$k]['goods_name'] = $goods_online_info['goods_name'];
$cart_list[$key]['bl_goods_list'][$k]['goods_image'] = $goods_online_info['goods_image'];
$cart_list[$key]['bl_goods_list'][$k]['goods_storage'] = $goods_online_info['goods_storage'];
$cart_list[$key]['bl_goods_list'][$k]['goods_storage_alarm'] = $goods_online_info['goods_storage_alarm'];
$cart_list[$key]['bl_goods_list'][$k]['gc_id'] = $goods_online_info['gc_id'];
//每個商品直降多少
$total_down_price += $cart_list[$key]['bl_goods_list'][$k]['down_price'] = ncPriceFormat($goods_online_info['goods_price'] - $goods_info['bl_goods_price']);
} else {
//商品已經下架
$cart_list[$key]['state'] = false;
$cart_list[$key]['storage_state'] = false;
}
}
$cart_list[$key]['down_price'] = ncPriceFormat($total_down_price);
}
}
示例9: intval
</tbody>
</table>
<div class="stat-info"> <span>下單量:
<strong><?php
echo intval($output['statcount']['ordernum']);
?>
</strong>
</span><span>下單商品數:
<strong><?php
echo intval($output['statcount']['goodsnum']);
?>
</strong>
</span><span>下單金額:
<strong><?php
echo ncPriceFormat($output['statcount']['orderamount']);
?>
</strong>
元 </span></div>
<div id="stat_tabs" class="w100pre close_float ui-tabs">
<div class="close_float tabmenu">
<ul class="tab pngFix">
<li><a href="#ordernum_div" nc_type="showlinelabels" data-param='{"type":"ordernum"}'>下單量</a></li>
<li><a href="#goodsnum_div" nc_type="showlinelabels" data-param='{"type":"goodsnum"}'>下單商品數</a></li>
<li><a href="#orderamount_div" nc_type="showlinelabels" data-param='{"type":"orderamount"}'>下單金額</a></li>
</ul>
</div>
<!-- 下單量 -->
<div id="ordernum_div" class="close_float"></div>
<!-- 下單商品件數 -->
<div id="goodsnum_div"></div>
示例10: cart_edit_quantityOp
/**
* 更新購物車購買數量
*/
public function cart_edit_quantityOp()
{
$cart_id = intval(abs($_POST['cart_id']));
$quantity = intval(abs($_POST['quantity']));
if (empty($cart_id) || empty($quantity)) {
output_error('參數錯誤');
}
$model_cart = Model('cart');
$cart_info = $model_cart->getCartInfo(array('cart_id' => $cart_id, 'buyer_id' => $this->member_info['member_id']));
//檢查是否為本人購物車
if ($cart_info['buyer_id'] != $this->member_info['member_id']) {
output_error('參數錯誤');
}
//檢查庫存是否充足
if (!$this->_check_goods_storage($cart_info, $quantity, $this->member_info['member_id'])) {
output_error('庫存不足');
}
$data = array();
$data['goods_num'] = $quantity;
$update = $model_cart->editCart($data, array('cart_id' => $cart_id));
if ($update) {
$return = array();
$return['quantity'] = $quantity;
$return['goods_price'] = ncPriceFormat($cart_info['goods_price']);
$return['total_price'] = ncPriceFormat($cart_info['goods_price'] * $quantity);
output_data($return);
} else {
output_error('修改失敗');
}
}
示例11: add_refund_allOp
/**
* 添加全部退款即取消訂單
*
*/
public function add_refund_allOp()
{
$model_order = Model('order');
$model_trade = Model('trade');
$model_refund = Model('refund_return');
$order_id = intval($_GET['order_id']);
$condition = array();
$condition['buyer_id'] = $_SESSION['member_id'];
$condition['order_id'] = $order_id;
$order = $model_refund->getRightOrderList($condition);
Tpl::output('order', $order);
$order_amount = $order['order_amount'];
//訂單金額
$condition = array();
$condition['buyer_id'] = $order['buyer_id'];
$condition['order_id'] = $order['order_id'];
$condition['goods_id'] = '0';
$condition['seller_state'] = array('lt', '3');
$refund_list = $model_refund->getRefundReturnList($condition);
$refund = array();
if (!empty($refund_list) && is_array($refund_list)) {
$refund = $refund_list[0];
}
$order_paid = $model_trade->getOrderState('order_paid');
//訂單狀態20:已付款
$payment_code = $order['payment_code'];
//支付方式
if ($refund['refund_id'] > 0 || $order['order_state'] != $order_paid || $payment_code == 'offline') {
//檢查訂單狀態,防止頁麵刷新不及時造成數據錯誤
showDialog(Language::get('wrong_argument'), 'index.php?act=member_order&op=index', 'error');
}
if (chksubmit()) {
$refund_array = array();
$refund_array['refund_type'] = '1';
//類型:1為退款,2為退貨
$refund_array['seller_state'] = '1';
//狀態:1為待審核,2為同意,3為不同意
$refund_array['order_lock'] = '2';
//鎖定類型:1為不用鎖定,2為需要鎖定
$refund_array['goods_id'] = '0';
$refund_array['order_goods_id'] = '0';
$refund_array['reason_id'] = '0';
$refund_array['reason_info'] = '取消訂單,全部退款';
$refund_array['goods_name'] = '訂單商品全部退款';
$refund_array['refund_amount'] = ncPriceFormat($order_amount);
$refund_array['buyer_message'] = $_POST['buyer_message'];
$refund_array['add_time'] = time();
$pic_array = array();
$pic_array['buyer'] = $this->upload_pic();
//上傳憑證
$info = serialize($pic_array);
$refund_array['pic_info'] = $info;
$state = $model_refund->addRefundReturn($refund_array, $order);
if ($state) {
$model_refund->editOrderLock($order_id);
showDialog(Language::get('nc_common_save_succ'), 'index.php?act=member_refund&op=index', 'succ');
} else {
showDialog(Language::get('nc_common_save_fail'), 'reload', 'error');
}
}
Tpl::showpage('member_refund_all');
}
示例12: general_listOp
/**
* 概況總覽
*/
public function general_listOp()
{
//獲得子分類ID
$gc_childid = $gc_childarr = array();
if ($this->choose_gcid > 0) {
//如果進行了分類搜索,則統計該分類下的子分類
$gc_childdepth = $this->gc_arr[$this->choose_gcid]['depth'] + 1;
$gc_childid = explode(',', $this->gc_arr[$this->choose_gcid]['child']);
if ($gc_childid) {
foreach ((array) $this->gc_arr as $k => $v) {
if (in_array($v['gc_id'], $gc_childid)) {
$gc_childarr[$v['gc_id']] = $v;
}
}
}
} else {
//如果沒有搜索分類,則默認統計一級分類
$gc_childdepth = 1;
foreach ((array) $this->gc_arr as $k => $v) {
if ($v['depth'] == 1) {
$gc_childarr[$v['gc_id']] = $v;
}
}
}
$statlist = array();
if ($gc_childarr) {
$model = Model('stat');
//查詢訂單商品信息
$where = array();
$where['order_isvalid'] = 1;
//計入統計的有效訂單
//計算開始時間和結束時間
$searchtime_arr[1] = strtotime(date('Y-m-d', time())) - 1;
//昨天23:59點
$searchtime_arr[0] = $searchtime_arr[1] - 86400 * 30 + 1;
//從昨天開始30天前
$where['order_add_time'] = array('between', $searchtime_arr);
if ($this->choose_gcid > 0) {
$where['gc_parentid_' . ($gc_childdepth - 1)] = $this->choose_gcid;
}
$field = 'gc_parentid_' . $gc_childdepth . ' as statgc_id,COUNT(DISTINCT goods_id) as ordergcount,SUM(goods_num) as ordergnum,SUM(goods_pay_price) as orderamount';
$ordergoods_list_tmp = $model->statByStatordergoods($where, $field, 0, 0, '', 'statgc_id');
foreach ((array) $ordergoods_list_tmp as $k => $v) {
$ordergoods_list[$v['statgc_id']] = $v;
}
//查詢商品信息
$field = 'gc_id_' . $gc_childdepth . ' as statgc_id,COUNT(*) as goodscount,AVG(goods_price) as priceavg';
$goods_list_tmp = $model->statByGoods(array('is_virtual' => 0), $field, 0, 0, '', 'statgc_id');
foreach ((array) $goods_list_tmp as $k => $v) {
$goods_list[$v['statgc_id']] = $v;
}
//將訂單和商品數組合並
$statlist_tmp = array();
foreach ($gc_childarr as $k => $v) {
$tmp = array();
$tmp['statgc_id'] = $v['gc_id'];
$tmp['gc_name'] = $v['gc_name'];
$tmp['ordergcount'] = ($t = $ordergoods_list[$v['gc_id']]['ordergcount']) ? $t : 0;
$tmp['ordergnum'] = ($t = $ordergoods_list[$v['gc_id']]['ordergnum']) ? $t : 0;
$tmp['orderamount'] = ($t = $ordergoods_list[$v['gc_id']]['orderamount']) ? $t : 0;
$tmp['goodscount'] = ($t = $goods_list[$v['gc_id']]['goodscount']) ? $t : 0;
$tmp['priceavg'] = ncPriceFormat(($t = $goods_list[$v['gc_id']]['priceavg']) ? $t : 0);
$tmp['unordergcount'] = intval($goods_list[$v['gc_id']]['goodscount']) - intval($ordergoods_list[$v['gc_id']]['ordergcount']);
//計算無銷量商品數
$statlist_tmp[] = $tmp;
}
$statlist = array();
//整理排序
$orderby = trim($this->search_arr['orderby']);
if (!$orderby) {
$orderby = 'orderamount desc';
}
$orderkeys = explode(' ', $orderby);
$keysvalue = $new_array = array();
foreach ($statlist_tmp as $k => $v) {
$keysvalue[$k] = $v[$orderkeys[0]];
}
if ($orderkeys[1] == 'asc') {
asort($keysvalue);
} else {
arsort($keysvalue);
}
reset($keysvalue);
foreach ($keysvalue as $k => $v) {
$statlist[$k] = $statlist_tmp[$k];
}
//導出Excel
if ($this->search_arr['exporttype'] == 'excel') {
//列表header
$statheader = array();
$statheader[] = array('text' => '類目名稱', 'key' => 'gc_name');
$statheader[] = array('text' => '平均價格(元)', 'key' => 'priceavg', 'isorder' => 1);
$statheader[] = array('text' => '有銷量商品數', 'key' => 'ordergcount', 'isorder' => 1);
$statheader[] = array('text' => '銷量', 'key' => 'ordergnum', 'isorder' => 1);
$statheader[] = array('text' => '銷售額(元)', 'key' => 'orderamount', 'isorder' => 1);
$statheader[] = array('text' => '商品總數', 'key' => 'goodscount', 'isorder' => 1);
$statheader[] = array('text' => '無銷量商品數', 'key' => 'unordergcount', 'isorder' => 1);
//.........這裏部分代碼省略.........
示例13: foreach
foreach ($output['voucher_list'] as $voucher) {
?>
<div title="<?php
echo $lang['cart_step1_voucher_usecondition'] . $voucher['voucher_limit'] . $lang['currency_zh'] . $lang['cart_step1_voucher'] . $lang['nc_colon'] . $voucher['voucher_code'];
?>
">
<input type="radio" value="<?php
echo $voucher['voucher_id'];
?>
" name="voucher_id" rel="voucher">
<?php
echo $lang['cart_step1_voucher_save'];
?>
<span class="cart-goods-price" nc_type="shipping_fee" value="<?php
echo $voucher['voucher_price'];
?>
"><em><?php
echo ncPriceFormat($voucher['voucher_price']);
?>
</em></span> (<?php
echo $voucher['voucher_desc'];
?>
)</div>
<?php
}
}
?>
</dd>
</dl>
<?php
}
示例14: reopen_addOp
/**
* 申請續簽
*/
public function reopen_addOp()
{
if (!chksubmit()) {
exit;
}
if (intval($_POST['re_grade_id']) <= 0 || intval($_POST['re_year']) <= 0) {
exit;
}
// 店鋪信息
$model_store = Model('store');
$store_info = $this->store_info;
if (empty($store_info['store_end_time'])) {
showDialog('您的店鋪使用期限無限製,無須續簽');
}
$model_store_reopen = Model('store_reopen');
//如果存在有未上傳憑證或審核中的信息,則不能再申請續簽
$condition = array();
$condition['re_state'] = array('in', array(0, 1));
$condition['re_store_id'] = $_SESSION['store_id'];
if ($model_store_reopen->getStoreReopenCount($condition)) {
showDialog('目前尚存在申請中的續簽信息,不能重複申請');
}
$data = array();
//取店鋪等級信息
$grade_list = rkcache('store_grade', true);
if (empty($grade_list[$_POST['re_grade_id']])) {
exit;
}
//取得店鋪信息
$data['re_grade_id'] = $_POST['re_grade_id'];
$data['re_grade_name'] = $grade_list[$_POST['re_grade_id']]['sg_name'];
$data['re_grade_price'] = $grade_list[$_POST['re_grade_id']]['sg_price'];
$data['re_store_id'] = $_SESSION['store_id'];
$data['re_store_name'] = $_SESSION['store_name'];
$data['re_year'] = intval($_POST['re_year']);
$data['re_pay_amount'] = $data['re_grade_price'] * $data['re_year'];
$data['re_create_time'] = TIMESTAMP;
if ($data['re_pay_amount'] == 0) {
// $data['re_start_time'] = strtotime(date('Y-m-d 0:0:0',$store_info['store_end_time']))+24*3600;
// $data['re_end_time'] = strtotime(date('Y-m-d 23:59:59', $data['re_start_time'])." +".intval($data['re_year'])." year");
$data['re_state'] = 1;
}
$insert = $model_store_reopen->addStoreReopen($data);
if ($insert) {
if ($data['re_pay_amount'] == 0) {
// $model_store->editStore(array('store_end_time'=>$data['re_end_time']),array('store_id'=>$_SESSION['store_id']));
showDialog('您的申請已經提交,請等待管理員審核', 'reload', 'succ', '', 5);
} else {
showDialog(Language::get('nc_common_save_succ') . ',需付款金額' . ncPriceFormat($data['re_pay_amount']) . '元,請盡快完成付款,付款完成後請上傳付款憑證', 'reload', 'succ', '', 5);
}
} else {
showDialog(Language::get('nc_common_del_fail'));
}
}
示例15: ncPriceFormat
<div class="eject_con">
<div id="warning"></div>
<form id="post_form" method="post" action="index.php?act=member_refund&op=add&order_id=<?php
echo $output['order']['order_id'];
?>
">
<input type="hidden" name="form_submit" value="ok" />
<dl>
<dt><?php
echo $lang['refund_order_amount'] . $lang['nc_colon'];
?>
</dt>
<dd><?php
echo ncPriceFormat($output['order']['order_amount']);
?>
</dd>
</dl>
<dl>
<dt class="required"><em class="pngFix"></em><?php
echo $lang['refund_order_refund'] . $lang['nc_colon'];
?>
</dt>
<dd>
<input type="text" class="text w50" name="order_refund" value="<?php
echo $output['refund']['order_refund'] > 0 ? $output['refund']['order_refund'] : $output['order']['order_amount'];
?>
" />
</dd>
</dl>
<dl>
<dt class="required"><em class="pngFix"></em><?php