本文整理汇总了PHP中helper::current_account_id方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::current_account_id方法的具体用法?PHP helper::current_account_id怎么用?PHP helper::current_account_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper
的用法示例。
在下文中一共展示了helper::current_account_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($cat_id = '', $urlFilter = null, $orderBy = 0, $tab = null, $page = 1, $cat_type = null, $view = null)
{
$tab = intval($tab);
$urlFilter = $this->RemoveXSS($urlFilter);
// 20130204 Andrew 俱乐部专区功能,俱乐部专区只能俱乐部访问
$goods_cat = $this->app->model('goods_cat')->dump($cat_id);
if ($goods_cat['cat_name'] == '俱乐部专区') {
$custom_user = kernel::single('custom_member')->get_custom_user(helper::current_account_id());
if ((!$custom_user['club'] || !$custom_user['vip']) && !$custom_user['leader']) {
$back_url = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site', 'act' => 'index'));
$this->splash('failed', $back_url, app::get('b2c')->_('本页需要认证俱乐部才能进入'));
}
}
// 20130204 End
$urlFilter = htmlspecialchars(urldecode($urlFilter));
$_GET['scontent'] = htmlspecialchars($_GET['scontent']);
if (!empty($urlFilter) && $urlFilter != $_GET['scontent']) {
$urlFilter .= '_' . $_GET['scontent'];
} else {
$urlFilter = $_GET['scontent'];
}
$virCatObj =& $this->app->model('goods_virtual_cat');
if ($cat_type) {
$vcatid = $cat_type;
$oSearch =& $this->app->model('search');
/** 颗粒缓存商品虚拟分类 **/
if (!cachemgr::get('goods_virtual_cat_' . intval($vcatid), $vcat)) {
cachemgr::co_start();
$vcat = $virCatObj->getList('cat_id,cat_path,virtual_cat_id,filter,virtual_cat_name as cat_name', array('virtual_cat_id' => intval($vcatid)));
cachemgr::set('goods_virtual_cat_' . intval($vcatid), $vcat, cachemgr::co_end());
}
$vcat = current($vcat);
$vcatFilters = $virCatObj->_mkFilter($vcat['filter']);
$vcatFilters = $virCatObj->getFilter($vcatFilters);
$old_cat_id = $cat_id;
$old_urlFilter = $urlFilter;
$cat_id = $cat_id ? $cat_id . implode(",", $vcatFilters['cat_id']) : implode(",", $vcatFilters['cat_id']);
$urlFilter = $urlFilter ? $urlFilter : $oSearch->encode($vcatFilters);
}
$page = $page > 1 ? intval($page) : 1;
if ($cat_id == '_ANY_') {
unset($cat_id);
}
if ($cat_id) {
$cat_id = explode(",", $cat_id);
foreach ($cat_id as $k => $v) {
if ($v) {
$cat_id[$k] = intval($v);
}
}
$this->id = implode(",", $cat_id);
} else {
$cat_id = array('');
$this->id = '';
}
$pageLimit = $this->app->getConf('gallery.display.listnum');
$pageLimit = $pageLimit ? $pageLimit : 20;
$this->pagedata['pdtPic'] = array('width' => 100, 'heigth' => 100);
$productCat =& $this->app->model('goods_cat');
$objGoods = $this->app->model('goods');
$global_runtime_path = "";
// ajx 这里添加对分类的判断,当分类不存在时不做缓存处理
if (!cachemgr::get('global_runtime_path' . $this->id, $global_runtime_path)) {
cachemgr::co_start();
if ($cat_type) {
$global_runtime_path = $virCatObj->getPath($cat_type, '');
} else {
$global_runtime_path = $productCat->getPath($cat_id[0], '');
}
cachemgr::set('global_runtime_path', $global_runtime_path, cachemgr::co_end());
}
/****ajx 以下是为了当搜索条件存在时 面包屑中显示 搜索条件 ***/
if ($_GET['scontent'] && strlen($urlFilter) > 0) {
$global_runtime_path = array(array('type' => 'goodsCat', 'title' => app::get('site')->_('首页'), 'link' => kernel::base_url(1)));
$title_ = explode('_', $urlFilter);
$title_arr = "";
foreach ($title_ as $val_xin) {
$title_xin = explode(',', $val_xin);
if (count($title_xin) > 2) {
unset($title_xin[0]);
foreach ($title_xin as $xin_val) {
$title_arr[] = $xin_val;
}
} else {
$title_arr[] = $title_xin[1];
}
}
$title = implode(',', $title_arr);
array_push($global_runtime_path, array('type' => 'goodsCat', 'title' => app::get('site')->_($title), 'link' => kernel::base_url(1)));
}
// ajx 以下是为了当无分类和搜索条件时 显示所有商品
if (count($global_runtime_path) < 2) {
$global_runtime_path = array(array('type' => 'goodsCat', 'title' => app::get('site')->_('首页'), 'link' => kernel::base_url(1)), array('type' => 'goodsCat', 'title' => app::get('site')->_('所有商品'), 'link' => kernel::base_url(1)));
}
$GLOBALS['runtime']['path'] = $global_runtime_path;
if ($cat_id[0]) {
if (!cachemgr::get('goods_cat_' . $cat_id[0], $this->cat_result)) {
cachemgr::co_start();
$this->cat_result = $productCat->getList('cat_name,gallery_setting,type_id', array('cat_id|in' => $cat_id), 0, 1);
cachemgr::set('goods_cat_' . $cat_id[0], $this->cat_result, cachemgr::co_end());
//.........这里部分代码省略.........
示例2: index
public function index($order_id, $selecttype = false)
{
$objOrder =& $this->app->model('orders');
$sdf = $objOrder->dump($order_id);
//用于omniture
$subsdf = array('order_objects' => array('*'), 'order_pmt' => array('*'));
$sdf2 = $objOrder->dump($order_id, '*', $subsdf);
//var_dump($sdf2['order_pmt'][0]['pmt_amount']);
foreach ($sdf2['order_objects'] as $key => $value) {
//var_dump($value);
$price2 = $value['price'];
if ($sdf2['order_pmt'][0]['pmt_amount']) {
$price2 = $value['price'] - $sdf2['order_pmt'][0]['pmt_amount'];
//$price2是折后价格 pmt_amount优惠价格
//var_dump($price2);
}
$order_products_id[] = $value['goods_id'] . ';' . $value['quantity'] . ';' . $value['price'] . ';event24=' . $price2;
}
$this->pagedata['order_products_id'] = ';' . implode(',;', $order_products_id);
$this->pagedata['order_event24'] = "purchase,event24";
// 校验订单的会员有效性.
$is_verified = $this->_check_verify_member($sdf['member_id']) ? $this->_check_verify_member($sdf['member_id']) : false;
// 校验订单的有效性.
if ($_COOKIE['ST_ShopEx-Order-Buy'] != md5($this->app->getConf('certificate.token') . $order_id) && !$is_verified) {
$this->begin();
$this->end(false, app::get('b2c')->_('订单无效!'), $this->gen_url(array('app' => 'site', 'ctl' => 'default', 'act' => 'index')));
}
if (!$sdf) {
$this->_response->set_http_response_code(404);
$this->_response->set_body(app::get('b2c')->_('订单号:') . $order_id . app::get('b2c')->_('不存在!'));
return;
}
$sdf['cur_money'] = $this->objMath->number_minus(array($sdf['cur_amount'], $sdf['payed']));
$this->pagedata['order'] = $sdf;
if ($selecttype) {
$selecttype = 1;
} else {
$selecttype = 0;
}
$this->pagedata['order']['selecttype'] = $selecttype;
$opayment = app::get('ectools')->model('payment_cfgs');
$this->pagedata['payments'] = $opayment->getListByCode($sdf['currency']);
$system_money_decimals = $this->app->getConf('system.money.decimals');
$system_money_operation_carryset = $this->app->getConf('system.money.operation.carryset');
foreach ($this->pagedata['payments'] as $key => &$arrPayments) {
if (!$sdf['member_id']) {
if (trim($arrPayments['app_id']) == 'deposit') {
unset($this->pagedata['payments'][$key]);
continue;
}
}
if ($arrPayments['app_id'] == $this->pagedata['order']['payinfo']['pay_app_id']) {
$this->pagedata['order']['payinfo']['pay_name'] = $arrPayments['app_name'];
$this->pagedata['order']['payinfo']['pay_des'] = $arrPayments['app_des'];
$arrPayments['cur_money'] = $this->objMath->formatNumber($this->pagedata['order']['cur_money'], $system_money_decimals, $system_money_operation_carryset);
$arrPayments['total_amount'] = $this->objMath->formatNumber($this->pagedata['order']['total_amount'], $system_money_decimals, $system_money_operation_carryset);
} else {
$arrPayments['cur_money'] = $this->pagedata['order']['cur_money'];
$cur_discount = $this->objMath->number_multiple(array($sdf['discount'], $this->pagedata['order']['cur_rate']));
if ($this->pagedata['order']['payinfo']['cost_payment'] > 0) {
if ($this->pagedata['order']['cur_money'] > 0) {
$cost_payments_rate = $this->objMath->number_div(array($arrPayments['cur_money'], $this->objMath->number_plus(array($this->pagedata['order']['cur_money'], $this->pagedata['order']['payed']))));
} else {
$cost_payments_rate = 0;
}
$cost_payment = $this->objMath->number_multiple(array($this->objMath->number_multiple(array($this->pagedata['order']['payinfo']['cost_payment'], $this->pagedata['order']['cur_rate'])), $cost_payments_rate));
$arrPayments['cur_money'] = $this->objMath->number_minus(array($arrPayments['cur_money'], $cur_discount));
$arrPayments['cur_money'] = $this->objMath->number_minus(array($arrPayments['cur_money'], $cost_payment));
$arrPayments['cur_money'] = $this->objMath->number_plus(array($arrPayments['cur_money'], $this->objMath->number_multiple(array($arrPayments['cur_money'], $arrPayments['pay_fee']))));
$arrPayments['cur_money'] = $this->objMath->number_plus(array($arrPayments['cur_money'], $cur_discount));
} else {
$arrPayments['cur_money'] = $this->objMath->number_minus(array($arrPayments['cur_money'], $cur_discount));
$cost_payment = $this->objMath->number_multiple(array($arrPayments['cur_money'], $arrPayments['pay_fee']));
$arrPayments['cur_money'] = $this->objMath->number_plus(array($arrPayments['cur_money'], $cost_payment));
$arrPayments['cur_money'] = $this->objMath->number_plus(array($arrPayments['cur_money'], $cur_discount));
}
$arrPayments['total_amount'] = $this->objMath->formatNumber($this->objMath->number_div(array($arrPayments['cur_money'], $this->pagedata['order']['cur_rate'])), $system_money_decimals, $system_money_operation_carryset);
$arrPayments['cur_money'] = $this->objMath->formatNumber($arrPayments['cur_money'], $system_money_decimals, $system_money_operation_carryset);
}
}
if ($this->pagedata['order']['payinfo']['pay_app_id'] == '-1') {
$this->pagedata['order']['payinfo']['pay_name'] = app::get('b2c')->_('货到付款');
}
$objCur = app::get('ectools')->model('currency');
$aCur = $objCur->getFormat($this->pagedata['order']['currency']);
$this->pagedata['order']['cur_def'] = $aCur['sign'];
$this->pagedata['return_url'] = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site_paycenter', 'act' => 'result'));
$this->pagedata['res_url'] = $this->app->res_url;
$this->pagedata['form_action'] = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site_paycenter', 'act' => 'dopayment', 'arg0' => 'order'));
$obj_order_payment_html = kernel::servicelist('b2c.order.pay_html');
$app_id = 'b2c';
if ($obj_order_payment_html) {
foreach ($obj_order_payment_html as $obj) {
$obj->gen_data($this, $app_id);
}
}
// 20121129 Andrew 谷歌跟踪代码
$custom_uid = helper::get_custom_uid(helper::current_account_id());
$this->pagedata['analytics'] = array();
$this->pagedata['analytics']['google'] .= "_gaq.push(['_trackEvent', 'Ecomm', 'Ecomm-Order', '{$custom_uid}||{$order_id}||{$sdf['itemnum']}', {$sdf['cur_money']}]);\n";
//.........这里部分代码省略.........
示例3: result
public function result($payment_id)
{
$app_ectools = app::get('ectools');
$oPayment = $app_ectools->model('payments');
$subsdf = array('orders' => array('*'));
$sdf_payment = $oPayment->dump($payment_id, '*', $subsdf);
if ($sdf_payment['orders']) {
// 得到订单日志
$objOrderlog = $this->app->model('order_log');
foreach ($sdf_payment['orders'] as $order_id => $arrOrderbills) {
$orderlog = $objOrderlog->get_latest_orderlist($arrOrderbills['rel_id'], $arrOrderbills['pay_object'], $arrOrderbills['bill_type']);
$arrOrderlogs[$orderlog['log_id']] = $orderlog;
}
$this->pagedata['payment'] =& $sdf_payment;
$this->pagedata['payment']['order_id'] = $order_id;
$this->pagedata['orderlog'] = $arrOrderlogs;
}
$this->pagedata['pay_succ'] = $app_ectools->getConf('site.paycenter.pay_succ');
$this->pagedata['pay_failure'] = $app_ectools->getConf('site.paycenter.pay_failure');
$this->pagedata['send_immediately'] = app::get('b2c')->getConf('site.order.send_type');
$this->pagedata['base_path'] = kernel::base_url() . '/';
$this->pagedata['payment_id'] = $payment_id;
// 20121129 Andrew 谷歌跟踪
$custom_uid = helper::get_custom_uid(helper::current_account_id());
$objOrders = $this->app->model('orders');
$arrOrders = $objOrders->dump($order_id, '*');
$objItems = $this->app->model('order_items');
$arrItems = $objItems->getList('*', array('order_id' => $order_id));
$this->pagedata['analytics'] = array();
$this->pagedata['analytics']['google'] .= "_gaq.push(['_addTrans', '{$order_id}', 'quyeba', '{$sdf_payment['cur_money']}', '{$arrOrders['cost_tax']}', '{$arrOrders['shipping']['shipping_name']}', '{$arrOrders['consignee']['area']}', '{$arrOrders['consignee']['addr']}']);\n";
foreach ($arrItems as $item) {
$this->pagedata['analytics']['google'] .= "_gaq.push(['_addItem', '{$order_id}', '{$item['bn']}', '{$item['name']}', '', '{$item['price']}', '{$item['nums']}']);\n";
//$this->pagedata['products_pay'] .= "{$item['goods_id']}; {$item['nums']};{$item['price']}; event27={$arrOrders['payed']}, ";
}
$this->pagedata['analytics']['google'] .= "_gaq.push(['_trackTrans']);\n";
$this->pagedata['analytics']['google'] .= "_gaq.push(['_trackEvent', 'Ecomm', 'Ecomm-Payment', '{$custom_uid}||{$order_id}', {$sdf_payment['cur_money']}]);\n";
// 20121129 End
$this->page('site/paycenter/result_' . $sdf_payment['pay_type'] . '.html');
}
示例4: index
public function index()
{
$db = kernel::database();
$objProduct =& $this->app->model('products');
//获取参数
$_getParams = $this->_request->get_params();
$gid = $_getParams[0];
$specImg = $_getParams[1];
$spec_id = $_getParams[2];
$this->id = $gid;
$this->customer_template_id = $gid;
$objGoods =& $this->app->model('goods');
$GLOBALS['runtime']['path'] = $objGoods->getPath($gid, '');
//当前登陆用户信息
$siteMember = $this->get_current_member();
//当前登陆用户等级
$this->site_member_lv_id = $siteMember['member_lv'];
$this->pagedata['this_member_lv_id'] = $this->site_member_lv_id;
//商品基本信息 goods表获取
$aGoods_list = $objGoods->getList("goods_id,name,english_title,bn,price,cost,mktprice,marketable,store,notify_num,score,weight,unit,brief,image_default_id,udfimg,thumbnail_pic,small_pic,big_pic,min_buy,package_scale,package_unit,package_use,score_setting,nostore_sell,goods_setting,disabled,spec_desc,adjunct,p_1,p_2,p_3,p_4,p_5,p_6,p_7,p_8,p_9,p_10,p_11,p_12,p_13,p_14,p_15,p_16,p_17,p_18,p_19,p_20,p_21,p_22,p_23,p_24,p_25,p_26,p_27,p_28,p_29,p_30,p_31,p_32,p_33,p_34,p_35,p_36,p_37,p_38,p_39,p_40,p_41,p_42,p_43,p_44,p_45,p_46,p_47,p_48,p_49,p_50,brand_id,type_id,cat_id,seo_info", array('goods_id' => $gid));
// 20130204 Andrew 俱乐部专区功能,俱乐部专区只能俱乐部访问
$goods_cat = $this->app->model('goods_cat')->dump($aGoods_list[0]['cat_id']);
if ($goods_cat['cat_name'] == '俱乐部专区') {
$custom_user = kernel::single('custom_member')->get_custom_user(helper::current_account_id());
if ((!$custom_user['club'] || !$custom_user['vip']) && !$custom_user['leader']) {
$back_url = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site', 'act' => 'index'));
$this->splash('failed', $back_url, app::get('b2c')->_('本页需要认证俱乐部才能进入'));
}
}
// 20130204 End
//获取促销商品折扣图片
$sgoods_image = $db->select("SELECT gpr.`goods_id`,gpr.`description`,srg.`image` FROM `sdb_b2c_goods_promotion_ref` as gpr\n left join sdb_b2c_sales_rule_goods as srg on gpr.rule_id = srg.rule_id\n WHERE gpr.`goods_id`=" . $aGoods_list[0]['goods_id'] . "");
$this->pagedata['simage'] = $sgoods_image;
//显示商品折扣价
if ($_COOKIE['S']['CART_TOTAL_PRICE']) {
$this->pagedata['username'] = $_COOKIE["SHOPEX_LOGIN_NAME"];
$this->pagedata['save_login_name'] = true;
}
//获取详细的商品数据(包含货品,品牌,规格,类型,图片)
$list2dump = kernel::single("b2c_goods_list2dump");
$aGoods = $list2dump->get_goods($aGoods_list[0], $this->site_member_lv_id);
if (!$aGoods || $aGoods === false || !$aGoods['product']) {
$this->_response->clean_all_headers()->set_http_response_code('404')->send_headers();
echo '无效商品!<br>可能是商品未上架';
exit;
}
//反序列化商品配件信息
if (!is_array($aGoods['adjunct'])) {
$aGoods['adjunct'] = unserialize($aGoods['adjunct']);
$adjunct_goods_num = 0;
foreach ($aGoods['adjunct'] as $goods_adjunct_key => $goods_adjunct_value) {
if ($goods_adjunct_value['items']['product_id']) {
$adjunct_goods_num += count($goods_adjunct_value['items']['product_id']);
}
}
$this->pagedata['adjunctGoodsNum'] = $adjunct_goods_num;
//配件的商品数量
$this->pagedata['adjunctNum'] = count($aGoods['adjunct']);
//配件组的数量
}
//设置模板
if ($aGoods['goods_setting']['goods_template']) {
$this->set_tmpl_file($aGoods['goods_setting']['goods_template']);
//添加模板
}
$this->set_tmpl('product');
if (is_array($aGoods['spec'])) {
foreach ($aGoods['spec'] as $sv) {
$specValue[] = $sv['spec_name'];
}
}
$this->pagedata['specShowItems'] = $specValue;
//计算商品冻结总数
$aGoods['freez'] = 0;
if (count($aGoods['product'])) {
foreach ($aGoods['product'] as $pdk => $pdv) {
if ($pdv['freez']) {
$aGoods['freez'] += $pdv['freez'];
}
}
}
//======商品会员价======
if ($aGoods['product']) {
//如果商品有货品处理价格
$priceArea = array();
if ($siteMember['member_lv']) {
$mlv = $siteMember['member_lv'];
} else {
$level =& $this->app->model('member_lv');
$mlv = $level->get_default_lv();
}
if ($mlv) {
foreach ($aGoods['product'] as $gpk => &$gpv) {
$currentPriceArea[] = $gpv['price']['price']['current_price'];
//销售价区域
$priceArea[] = $gpv['price']['price']['price'];
//销售价区域
if ($gpv['price']['mktprice']['price'] == '' || $gpv['price']['mktprice']['price'] == null) {
$mktpriceArea[] = $objProduct->getRealMkt($gpv['price']['mktprice']['price']);
} else {
//.........这里部分代码省略.........