当前位置: 首页>>代码示例>>PHP>>正文


PHP uk86_ncPriceFormat函数代码示例

本文整理汇总了PHP中uk86_ncPriceFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP uk86_ncPriceFormat函数的具体用法?PHP uk86_ncPriceFormat怎么用?PHP uk86_ncPriceFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了uk86_ncPriceFormat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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 uk86_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 uk86_callback(false, '该商品库存不足');
     }
     $goods_info['quantity'] = $quantity;
     $goods_info['goods_total'] = uk86_ncPriceFormat($goods_info['goods_price'] * $goods_info['quantity']);
     $goods_info['goods_image_url'] = uk86_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 uk86_callback(true, '', $return);
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:39,代码来源:buy_virtual.logic.php

示例2: indexOp

 public function indexOp()
 {
     $model_cart = Model('cart');
     $logic_buy_1 = uk86_logic('buy_1');
     //购物车列表
     $cart_list = $model_cart->listCart('db', array('buyer_id' => $_SESSION['member_id']));
     //购物车列表 [得到最新商品属性及促销信息]
     $cart_list = $logic_buy_1->getGoodsCartList($cart_list);
     //购物车商品以店铺ID分组显示,并计算商品小计,店铺小计与总价由JS计算得出
     $store_cart_list = array();
     foreach ($cart_list as $cart) {
         $cart['goods_total'] = uk86_ncPriceFormat($cart['goods_price'] * $cart['goods_num']);
         $store_cart_list[$cart['store_id']][] = $cart;
     }
     Tpl::output('store_cart_list', $store_cart_list);
     //店铺信息
     $store_list = Model('store')->getStoreMemberIDList(array_keys($store_cart_list));
     Tpl::output('store_list', $store_list);
     //取得店铺级活动 - 可用的满即送活动
     $mansong_rule_list = $logic_buy_1->getMansongRuleList(array_keys($store_cart_list));
     Tpl::output('mansong_rule_list', $mansong_rule_list);
     //取得哪些店铺有满免运费活动
     $free_freight_list = $logic_buy_1->getFreeFreightActiveList(array_keys($store_cart_list));
     Tpl::output('free_freight_list', $free_freight_list);
     Tpl::showpage('cart.index');
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:26,代码来源:wap_cart.php

示例3: add_refundOp

 /**
  * 添加兑换码退款
  *
  */
 public function add_refundOp()
 {
     $model_vr_refund = Model('vr_refund');
     $order_id = intval($_GET['order_id']);
     if ($order_id < 1) {
         //参数验证
         showDialog(Uk86Language::uk86_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(Uk86Language::uk86_get('wrong_argument'), 'index.php?act=member_vr_order&op=index', 'error');
     }
     if (uk86_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(Uk86Language::uk86_get('wrong_argument'), 'reload', 'error');
         }
         $refund_array['code_sn'] = rtrim($code_sn, ',');
         $refund_array['admin_state'] = '1';
         //状态:1为待审核,2为同意,3为不同意
         $refund_array['refund_amount'] = uk86_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(Uk86Language::uk86_get('nc_common_save_succ'), 'index.php?act=member_vr_refund&op=index', 'succ');
         } else {
             showDialog(Uk86Language::uk86_get('nc_common_save_fail'), 'reload', 'error');
         }
     }
     Tpl::showpage('member_vr_refund_add');
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:62,代码来源:member_vr_refund.php

示例4: uk86_ncPriceFormat

}
?>
  </div>
  <div class="item-order">
    <dl>
      <dt>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费:</dt>
      <dd><?php 
echo $output['order']['shipping_fee'] > 0 ? uk86_ncPriceFormat($output['order']['shipping_fee']) : $lang['nc_common_shipping_free'];
?>
</dd>
    </dl>
    <dl>
      <dt>订单总额:</dt>
      <dd><strong><?php 
echo $lang['currency'];
echo uk86_ncPriceFormat($output['order']['order_amount']);
?>
        <?php 
if ($output['order']['refund_amount'] > 0) {
    ?>
        (<?php 
    echo $lang['refund_add'] . $lang['nc_colon'] . $lang['currency'] . $output['order']['refund_amount'];
    ?>
)
        <?php 
}
?>
        </strong> </dd>
    </dl>
    <dl class="line">
      <dt>订单编号:</dt>
开发者ID:wangjiang988,项目名称:ukshop,代码行数:31,代码来源:store_refund_right.php

示例5: export_refund_orderOp

 /**
  * 导出结算退单明细CSV
  *
  */
 public function export_refund_orderOp()
 {
     if (!preg_match('/^20\\d{5,12}$/', $_GET['ob_no'])) {
         uk86_showMessage('参数错误', '', 'html', 'error');
     }
     if (substr($_GET['ob_no'], 6) != $_SESSION['store_id']) {
         uk86_showMessage('参数错误', '', 'html', 'error');
     }
     $model_bill = Model('bill');
     $bill_info = $model_bill->getOrderBillInfo(array('ob_no' => $_GET['ob_no']));
     if (!$bill_info) {
         uk86_showMessage('参数错误', '', 'html', 'error');
     }
     $model_refund = Model('refund_return');
     $condition = array();
     $condition['seller_state'] = 2;
     $condition['store_id'] = $_SESSION['store_id'];
     $condition['goods_id'] = array('gt', 0);
     $if_start_date = preg_match('/^20\\d{2}-\\d{2}-\\d{2}$/', $_GET['query_start_date']);
     $if_end_date = preg_match('/^20\\d{2}-\\d{2}-\\d{2}$/', $_GET['query_end_date']);
     $start_unixtime = $if_start_date ? strtotime($_GET['query_start_date']) : null;
     $end_unixtime = $if_end_date ? strtotime($_GET['query_end_date']) : null;
     if ($if_start_date || $if_end_date) {
         $condition['admin_time'] = array('time', array($start_unixtime, $end_unixtime));
     } else {
         $condition['admin_time'] = array('between', "{$bill_info['ob_start_date']},{$bill_info['ob_end_date']}");
     }
     if (!is_numeric($_GET['curpage'])) {
         $count = $model_refund->getRefundReturn($condition);
         $array = array();
         if ($count > self::EXPORT_SIZE) {
             //显示下载链接
             $page = ceil($count / self::EXPORT_SIZE);
             for ($i = 1; $i <= $page; $i++) {
                 $limit1 = ($i - 1) * self::EXPORT_SIZE + 1;
                 $limit2 = $i * self::EXPORT_SIZE > $count ? $count : $i * self::EXPORT_SIZE;
                 $array[$i] = $limit1 . ' ~ ' . $limit2;
             }
             Tpl::output('list', $array);
             Tpl::output('murl', 'index.php?act=store_bill&op=show_bill&query_type=refund&ob_no=' . $_GET['ob_no']);
             Tpl::showpage('store_export.excel');
             exit;
         } else {
             //如果数量小,直接下载
             $data = $model_refund->getRefundReturnList($condition, '', '*,ROUND(refund_amount*commis_rate/100,2) as commis_amount', self::EXPORT_SIZE);
         }
     } else {
         //下载
         $limit1 = ($_GET['curpage'] - 1) * self::EXPORT_SIZE;
         $limit2 = self::EXPORT_SIZE;
         $data = $model_refund->getRefundReturnList(condition, '', '*,ROUND(refund_amount*commis_rate/100,2) as commis_amount', "{$limit1},{$limit2}");
     }
     if (is_array($data) && count($data) == 1 && $data[0]['refund_id'] == '') {
         $refund_list = array();
     }
     $export_data = array();
     $export_data[0] = array('退单编号', '订单编号', '退单金额', '退单佣金', '类型', '退款日期', '买家', '买家编号');
     $refund_amount = 0;
     $commis_totals = 0;
     $k = 0;
     foreach ($data as $v) {
         $export_data[$k + 1][] = 'NC' . $v['refund_sn'];
         $export_data[$k + 1][] = 'NC' . $v['order_sn'];
         $refund_amount += $export_data[$k + 1][] = $v['refund_amount'];
         $commis_totals += $export_data[$k + 1][] = uk86_ncPriceFormat($v['commis_amount']);
         $export_data[$k + 1][] = str_replace(array(1, 2), array('退款', '退货'), $v['refund_type']);
         $export_data[$k + 1][] = date('Y-m-d', $v['admin_time']);
         $export_data[$k + 1][] = $v['buyer_name'];
         $export_data[$k + 1][] = $v['buyer_id'];
         $k++;
     }
     $count = count($export_data);
     $export_data[$count][] = '';
     $export_data[$count][] = '合计';
     $export_data[$count][] = $refund_amount;
     $export_data[$count][] = $commis_totals;
     $csv = new Uk86Csv();
     $export_data = $csv->uk86_charset($export_data, CHARSET, 'gbk');
     $csv->filename = $csv->uk86_charset('退单明细-', CHARSET) . $_GET['ob_no'];
     $csv->uk86_export($export_data);
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:85,代码来源:store_bill.php

示例6: foreach

if (is_array($output['cost_list']) && !empty($output['cost_list'])) {
    ?>
      <?php 
    foreach ($output['cost_list'] as $cost_info) {
        ?>
      <tr class="hover">
        <td class="align-center"><?php 
        echo $output['store_info']['store_name'];
        ?>
</td>
        <td class="align-center"><?php 
        echo $cost_info['cost_remark'];
        ?>
</td>
        <td class="align-center"><?php 
        echo uk86_ncPriceFormat($cost_info['cost_price']);
        ?>
</td>
        <td class="align-center"><?php 
        echo date('Y-m-d', $cost_info['cost_time']);
        ?>
</td>
      </tr>
      <?php 
    }
    ?>
      <?php 
} else {
    ?>
      <tr class="no_data">
        <td colspan="15"><?php 
开发者ID:wangjiang988,项目名称:ukshop,代码行数:31,代码来源:bill_order_bill.show.cost_list.php

示例7: changePa

 /**
  * 变更预存款
  * @param unknown $change_type
  * @param unknown $data
  * @throws Exception
  * @return unknown
  */
 public function changePa($change_type, $data = array(), $refund = array())
 {
     $data_log = array();
     $data_pd = array();
     $data_msg = array();
     $data_log['lg_member_id'] = $data['member_id'];
     $data_log['lg_member_name'] = $data['member_name'];
     $data_log['lg_add_time'] = TIMESTAMP;
     $data_log['lg_type'] = $change_type;
     $data_msg['time'] = date('Y-m-d H:i:s');
     $data_msg['pd_url'] = uk86_urlShop('predeposit', 'pd_log_list');
     switch ($change_type) {
         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;
         default:
             throw new Exception('参数错误');
             break;
     }
     //转到第三方退款api
     $update = $this->_api_refund($data['payment_code'], $refund);
     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'] = uk86_ncPriceFormat($data_msg['av_amount']);
     $data_msg['freeze_amount'] = uk86_ncPriceFormat($data_msg['freeze_amount']);
     $param['param'] = $data_msg;
     Uk86QueueClient::push('sendMemberMsg', $param);
     return $insert;
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:57,代码来源:refund_to_pay.model.php

示例8: generalOp

 /**
  * 促销分析
  */
 public function generalOp()
 {
     $model = Model('stat');
     //统计的日期0点
     $stat_time = strtotime(date('Y-m-d', time())) - 86400;
     /*
      * 昨日最新情报
      */
     $stime = $stat_time;
     $etime = $stat_time + 86400 - 1;
     $statnew_arr = array();
     //查询订单表下单量、下单金额、下单客户数、平均客单价
     $where = array();
     $where['order_isvalid'] = 1;
     //计入统计的有效订单
     $where['order_add_time'] = array('between', array($stime, $etime));
     $field = ' COUNT(*) as ordernum, SUM(order_amount) as orderamount, COUNT(DISTINCT buyer_id) as ordermembernum, AVG(order_amount) as orderavg ';
     $stat_order = $model->getoneByStatorder($where, $field);
     $statnew_arr['ordernum'] = ($t = $stat_order['ordernum']) ? $t : 0;
     $statnew_arr['orderamount'] = uk86_ncPriceFormat(($t = $stat_order['orderamount']) ? $t : 0);
     $statnew_arr['ordermembernum'] = ($t = $stat_order['ordermembernum']) ? $t : 0;
     $statnew_arr['orderavg'] = uk86_ncPriceFormat(($t = $stat_order['orderavg']) ? $t : 0);
     unset($stat_order);
     //查询订单商品表下单商品数
     $where = array();
     $where['order_isvalid'] = 1;
     //计入统计的有效订单
     $where['order_add_time'] = array('between', array($stime, $etime));
     $field = ' SUM(goods_num) as ordergoodsnum,AVG(goods_pay_price/goods_num) as priceavg ';
     $stat_ordergoods = $model->getoneByStatordergoods($where, $field);
     $statnew_arr['ordergoodsnum'] = ($t = $stat_ordergoods['ordergoodsnum']) ? $t : 0;
     $statnew_arr['priceavg'] = uk86_ncPriceFormat(($t = $stat_ordergoods['priceavg']) ? $t : 0);
     unset($stat_ordergoods);
     //新增会员数
     $where = array();
     $where['member_time'] = array('between', array($stime, $etime));
     $field = ' COUNT(*) as newmember ';
     $stat_member = $model->getoneByMember($where, $field);
     $statnew_arr['newmember'] = ($t = $stat_member['newmember']) ? $t : 0;
     unset($stat_member);
     //会员总数
     $where = array();
     $field = ' COUNT(*) as membernum ';
     $stat_member = $model->getoneByMember($where, $field);
     $statnew_arr['membernum'] = ($t = $stat_member['membernum']) ? $t : 0;
     unset($stat_member);
     //新增店铺
     $where = array();
     $where['store_time'] = array('between', array($stime, $etime));
     $field = ' COUNT(*) as newstore ';
     $stat_store = $model->getoneByStore($where, $field);
     $statnew_arr['newstore'] = ($t = $stat_store['newstore']) ? $t : 0;
     unset($stat_store);
     //店铺总数
     $where = array();
     $field = ' COUNT(*) as storenum ';
     $stat_store = $model->getoneByStore($where, $field);
     $statnew_arr['storenum'] = ($t = $stat_store['storenum']) ? $t : 0;
     unset($stat_store);
     //新增商品,商品总数
     $goods_list = $model->statByGoods(array('is_virtual' => 0), "COUNT(*) as goodsnum, SUM(IF(goods_addtime>={$stime} and goods_addtime<={$etime},1,0)) as newgoods");
     $statnew_arr['goodsnum'] = ($t = $goods_list[0]['goodsnum']) > 0 ? $t : 0;
     $statnew_arr['newgoods'] = ($t = $goods_list[0]['newgoods']) > 0 ? $t : 0;
     /*
      * 昨日销售走势
      */
     //构造横轴数据
     for ($i = 0; $i < 24; $i++) {
         //统计图数据
         $curr_arr[$i] = 0;
         //今天
         $up_arr[$i] = 0;
         //昨天
         //横轴
         $stat_arr['xAxis']['categories'][] = "{$i}";
     }
     $stime = $stat_time - 86400;
     //昨天0点
     $etime = $stat_time + 86400 - 1;
     //今天24点
     $yesterday_day = @date('d', $stime);
     //昨天日期
     $today_day = @date('d', $etime);
     //今天日期
     $where = array();
     $where['order_isvalid'] = 1;
     //计入统计的有效订单
     $where['order_add_time'] = array('between', array($stime, $etime));
     $field = ' SUM(order_amount) as orderamount,DAY(FROM_UNIXTIME(order_add_time)) as dayval,HOUR(FROM_UNIXTIME(order_add_time)) as hourval ';
     $stat_order = $model->statByStatorder($where, $field, 0, 0, '', 'dayval,hourval');
     if ($stat_order) {
         foreach ($stat_order as $k => $v) {
             if ($today_day == $v['dayval']) {
                 $curr_arr[$v['hourval']] = intval($v['orderamount']);
             }
             if ($yesterday_day == $v['dayval']) {
                 $up_arr[$v['hourval']] = intval($v['orderamount']);
//.........这里部分代码省略.........
开发者ID:wangjiang988,项目名称:ukshop,代码行数:101,代码来源:stat_general.php

示例9: complain_closeOp

 public function complain_closeOp()
 {
     //获取输入的数据
     $complain_id = intval($_POST['complain_id']);
     $final_handle_message = trim($_POST['final_handle_message']);
     //验证输入的数据
     $obj_validate = new Uk86Validate();
     $obj_validate->validateparam = array(array("input" => $final_handle_message, "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Uk86Language::uk86_get('final_handle_message_error')));
     $error = $obj_validate->uk86_validate();
     if ($error != '') {
         uk86_showMessage($error);
     }
     $complain_info = $this->get_complain_info($complain_id);
     $current_state = intval($complain_info['complain_state']);
     if ($current_state !== self::STATE_FINISH) {
         $model_complain = Model('complain');
         $update_array = array();
         $update_array['complain_state'] = self::STATE_FINISH;
         $update_array['final_handle_message'] = $final_handle_message;
         $update_array['final_handle_datetime'] = time();
         $update_array['final_handle_member_id'] = $this->get_admin_id();
         $where_array = array();
         $where_array['complain_id'] = $complain_id;
         if ($model_complain->updateComplain($update_array, $where_array)) {
             if (intval($complain_info['complain_subject_id']) == 1) {
                 //退款信息
                 $order = $this->get_order_info($complain_info['order_id']);
                 $model_refund = Model('refund_return');
                 $list = $model_refund->getComplainRefundList($order, $complain_info['order_goods_id']);
                 $refund_goods = $list['goods'];
                 //可退商品
                 if (!empty($refund_goods) && is_array($refund_goods)) {
                     $checked_goods = $_POST['checked_goods'];
                     foreach ($refund_goods as $key => $value) {
                         $goods_id = $value['rec_id'];
                         //订单商品表编号
                         if (!empty($checked_goods) && array_key_exists($goods_id, $checked_goods)) {
                             //验证提交的商品属于订单
                             $refund_array = array();
                             $refund_array['refund_type'] = '1';
                             //类型:1为退款,2为退货
                             $refund_array['seller_state'] = '2';
                             //卖家处理状态:1为待审核,2为同意,3为不同意
                             $refund_array['refund_state'] = '2';
                             //状态:1为处理中,2为待管理员处理,3为已完成
                             $refund_array['order_lock'] = '1';
                             //锁定类型:1为不用锁定,2为需要锁定
                             $refund_array['refund_amount'] = uk86_ncPriceFormat($value['goods_refund']);
                             $refund_array['reason_id'] = '0';
                             $refund_array['reason_info'] = '投诉成功';
                             $refund_array['buyer_message'] = '投诉成功,待管理员确认退款';
                             $refund_array['seller_message'] = '投诉成功,待管理员确认退款';
                             $refund_array['add_time'] = time();
                             $refund_array['seller_time'] = time();
                             $model_refund->addRefundReturn($refund_array, $order, $value);
                         }
                     }
                 }
             }
             $this->log(L('complain_close_success') . '[' . $complain_id . ']', 1);
             uk86_showMessage(Uk86Language::uk86_get('complain_close_success'), $this->get_complain_state_link($current_state));
         } else {
             uk86_showMessage(Uk86Language::uk86_get('complain_close_fail'), $this->get_complain_state_link($current_state));
         }
     } else {
         uk86_showMessage(Uk86Language::uk86_get('param_error'), '');
     }
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:68,代码来源:complain.php

示例10: getBundlingCacheByGoodsId

 /**
  * 根据商品id查询套餐数据
  * @param unknown $goods_id
  */
 public function getBundlingCacheByGoodsId($goods_id)
 {
     $array = $this->_rGoodsBundlingCache($goods_id);
     if (empty($array)) {
         $bundling_array = array();
         $b_goods_array = array();
         // 根据商品id查询bl_id
         $b_g_list = $this->getBundlingGoodsList(array('goods_id' => $goods_id, 'bl_appoint' => 1), 'bl_id');
         if (!empty($b_g_list)) {
             $b_id_array = array();
             foreach ($b_g_list as $val) {
                 $b_id_array[] = $val['bl_id'];
             }
             // 查询套餐列表
             $bundling_list = $this->getBundlingOpenList(array('bl_id' => array('in', $b_id_array)));
             // 整理
             if (!empty($bundling_list)) {
                 foreach ($bundling_list as $val) {
                     $bundling_array[$val['bl_id']]['id'] = $val['bl_id'];
                     $bundling_array[$val['bl_id']]['name'] = $val['bl_name'];
                     $bundling_array[$val['bl_id']]['cost_price'] = 0;
                     $bundling_array[$val['bl_id']]['price'] = $val['bl_discount_price'];
                     $bundling_array[$val['bl_id']]['freight'] = $val['bl_freight'];
                 }
                 $blid_array = array_keys($bundling_array);
                 $b_goods_list = $this->getBundlingGoodsList(array('bl_id' => array('in', $blid_array)));
                 if (!empty($b_goods_list) && count($b_goods_list) > 1) {
                     $goodsid_array = array();
                     foreach ($b_goods_list as $val) {
                         $goodsid_array[] = $val['goods_id'];
                     }
                     $goods_list = Model('goods')->getGoodsList(array('goods_id' => array('in', $goodsid_array)), 'goods_id,goods_name,goods_price,goods_image');
                     $goods_list = uk86_array_under_reset($goods_list, 'goods_id');
                     foreach ($b_goods_list as $val) {
                         if (isset($goods_list[$val['goods_id']])) {
                             $k = intval($val['goods_id']) == $goods_id ? 0 : $val['goods_id'];
                             // 排序当前商品放到最前面
                             $b_goods_array[$val['bl_id']][$k]['id'] = $val['goods_id'];
                             $b_goods_array[$val['bl_id']][$k]['image'] = uk86_thumb($goods_list[$val['goods_id']], 240);
                             $b_goods_array[$val['bl_id']][$k]['name'] = $goods_list[$val['goods_id']]['goods_name'];
                             $b_goods_array[$val['bl_id']][$k]['shop_price'] = uk86_ncPriceFormat($goods_list[$val['goods_id']]['goods_price']);
                             $b_goods_array[$val['bl_id']][$k]['price'] = uk86_ncPriceFormat($val['bl_goods_price']);
                             $bundling_array[$val['bl_id']]['cost_price'] += $goods_list[$val['goods_id']]['goods_price'];
                         }
                     }
                 }
             }
         }
         $array = array('bundling_array' => serialize($bundling_array), 'b_goods_array' => serialize($b_goods_array));
         $this->_wGoodsBundlingCache($goods_id, $array);
     }
     return $array;
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:57,代码来源:p_bundling.model.php

示例11: hotrank_listOp


//.........这里部分代码省略.........
     /**
      * 飙升榜
      */
     $soaring_statlist = array();
     //飙升榜数组
     //查询期间产生订单的店铺数
     $where = array();
     //店铺分类
     $search_sclass = intval($_REQUEST['search_sclass']);
     if ($search_sclass) {
         $where['sc_id'] = $search_sclass;
     }
     $where['order_isvalid'] = 1;
     //计入统计的有效订单
     $where['order_add_time'] = array('between', $searchtime_arr);
     $field = 'COUNT(*) as countnum';
     $countnum = $model->getoneByStatorder($where, $field);
     $countnum = $countnum['countnum'];
     if ($countnum > 0) {
         $store_arr = array();
         $field = 'store_id,store_name,order_amount';
         for ($i = 0; $i < $countnum; $i += 1000) {
             //由于数据库底层的限制,所以每次查询1000条
             $order_list = array();
             $order_list = $model->statByStatorder($where, $field, 0, $i . ',1000', 'order_id');
             foreach ((array) $order_list as $k => $v) {
                 $store_arr[$v['store_id']]['orderamount'] = $store_arr[$v['store_id']]['orderamount'] + $v['order_amount'];
                 $store_arr[$v['store_id']]['ordernum'] = intval($store_arr[$v['store_id']]['ordernum']) + 1;
                 $store_arr[$v['store_id']]['store_name'] = $v['store_name'];
                 $store_arr[$v['store_id']]['store_id'] = $v['store_id'];
             }
         }
         //查询同一时间周期相比的环比数值
         $where = array();
         $stime = $searchtime_arr[0] - ($searchtime_arr[1] - $searchtime_arr[0]) - 1;
         $etime = $searchtime_arr[0] - 1;
         //店铺分类
         $search_sclass = intval($_REQUEST['search_sclass']);
         if ($search_sclass) {
             $where['sc_id'] = $search_sclass;
         }
         $where['order_isvalid'] = 1;
         //计入统计的有效订单
         $where['order_add_time'] = array('between', array($stime, $etime));
         $field = 'COUNT(*) as up_countnum';
         $up_countnum = $model->getoneByStatorder($where, $field);
         $up_countnum = $up_countnum['up_countnum'];
         $up_store_arr = array();
         if ($up_countnum > 0) {
             $field = 'store_id,store_name,order_amount';
             for ($i = 0; $i < $up_countnum; $i += 1000) {
                 //由于数据库底层的限制,所以每次查询1000条
                 $order_list = array();
                 $order_list = $model->statByStatorder($where, $field, 0, $i . ',1000', 'store_id');
                 foreach ((array) $order_list as $k => $v) {
                     $up_store_arr[$v['store_id']]['orderamount'] = $up_store_arr[$v['store_id']]['orderamount'] + $v['order_amount'];
                     $up_store_arr[$v['store_id']]['ordernum'] = intval($up_store_arr[$v['store_id']]['ordernum']) + 1;
                 }
             }
         }
         //计算环比飙升数值
         $soaring_arr = array();
         foreach ((array) $store_arr as $k => $v) {
             if ($up_store_arr[$k][$_GET['type']] > 0) {
                 //上期数值大于0,则计算飙升值,否则不计入统计
                 $soaring_arr[$k] = round(($v[$_GET['type']] - $up_store_arr[$k][$_GET['type']]) / $up_store_arr[$k][$_GET['type']] * 100, 2);
             }
         }
         arsort($soaring_arr);
         //降序排列数组
         $i = 1;
         //取出前10名飙升店铺
         foreach ((array) $soaring_arr as $k => $v) {
             if ($i <= $datanum) {
                 $tmp = array();
                 $tmp['sort'] = $i;
                 $tmp['store_name'] = $store_arr[$k]['store_name'];
                 $tmp['store_id'] = $store_arr[$k]['store_id'];
                 $tmp['hb'] = $v;
                 switch ($_GET['type']) {
                     case 'ordernum':
                         $tmp['ordernum'] = $store_arr[$k]['ordernum'];
                         break;
                     case 'orderamount':
                         $tmp['orderamount'] = uk86_ncPriceFormat($store_arr[$k]['orderamount']);
                         break;
                 }
                 $soaring_statlist[] = $tmp;
                 $i++;
             } else {
                 break;
             }
         }
     }
     Tpl::output('soaring_statlist', $soaring_statlist);
     Tpl::output('statlist', $statlist);
     Tpl::output('sort_text', $sort_text);
     Tpl::output('stat_field', $_GET['type']);
     Tpl::showpage('stat.store.hotrank.list', 'null_layout');
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:101,代码来源:stat_store.php

示例12: 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(Uk86Language::uk86_get('wrong_argument'), 'index.php?act=member_order&op=index', 'error');
     }
     if (uk86_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'] = uk86_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(Uk86Language::uk86_get('nc_common_save_succ'), 'index.php?act=member_refund&op=index', 'succ');
         } else {
             showDialog(Uk86Language::uk86_get('nc_common_save_fail'), 'reload', 'error');
         }
     }
     Tpl::showpage('member_refund_all');
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:66,代码来源:member_refund.php

示例13: getXianshiGoodsExtendInfo

 /**
  * 获取限时折扣商品扩展信息
  * @param array $xianshi_info
  * @return array 扩展限时折扣信息
  *
  */
 public function getXianshiGoodsExtendInfo($xianshi_info)
 {
     $xianshi_info['goods_url'] = uk86_urlShop('goods', 'index', array('goods_id' => $xianshi_info['goods_id']));
     $xianshi_info['image_url'] = uk86_cthumb($xianshi_info['goods_image'], 60, $xianshi_info['store_id']);
     $xianshi_info['xianshi_price'] = uk86_ncPriceFormat($xianshi_info['xianshi_price']);
     $xianshi_info['xianshi_discount'] = number_format($xianshi_info['xianshi_price'] / $xianshi_info['goods_price'] * 10, 1) . '折';
     return $xianshi_info;
 }
开发者ID:wangjiang988,项目名称:ukshop,代码行数:14,代码来源:p_xianshi_goods.model.php

示例14: uk86_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 uk86_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>
开发者ID:wangjiang988,项目名称:ukshop,代码行数:31,代码来源:widget_goods_list.php

示例15: uk86_ncPriceFormat

        }
        ?>
        <td><?php 
        echo $output['order_list'][$code_info['order_id']]['buyer_name'];
        ?>
</td>
        <td><?php 
        echo $output['order_list'][$code_info['order_id']]['order_sn'];
        ?>
</td>
        <td><?php 
        echo $code_info['pay_price'];
        ?>
</td>
        <td><?php 
        echo uk86_ncPriceFormat($code_info['pay_price'] * $code_info['commis_rate'] / 100);
        ?>
</td>
        <td>
       	<a target="_blank" href="index.php?act=store_vr_order&op=show_order&order_id=<?php 
        echo $code_info['order_id'];
        ?>
"><?php 
        echo $lang['nc_view'];
        ?>
</a>
        </td>
      </tr>
      <?php 
    }
    ?>
开发者ID:wangjiang988,项目名称:ukshop,代码行数:31,代码来源:store_vr_bill.show.code_list.php


注:本文中的uk86_ncPriceFormat函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。