本文整理汇总了PHP中obj::getProductInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP obj::getProductInfo方法的具体用法?PHP obj::getProductInfo怎么用?PHP obj::getProductInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obj
的用法示例。
在下文中一共展示了obj::getProductInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: product
/**
* 产品显示页面
*
*/
private function product()
{
require_once "shopGoods.class.php";
$obj_shop_goods = new ShopGoodsClass();
/*当前产品信息*/
$condition['goods_id'] = intval($this->_input['id']);
if ($condition['goods_id'] == 0) {
header("Location:index.php");
exit;
}
$condition['no_state'] = 1;
$product_array = $this->obj_product->getProductInfo($condition);
/*产品颜色,产品规格*/
$c_array = @explode('|', $product_array['goods_color']);
$s_array = @explode('|', $product_array['goods_size']);
$color_select = $product_array['goods_color'] != '' ? Common::Select('goods_color', array_combine($c_array, $c_array)) : '';
$size_select = $product_array['goods_size'] != '' ? Common::Select('goods_size', array_combine($s_array, $s_array)) : '';
$this->output('color_select', $color_select);
//颜色输出
$this->output('size_select', $size_select);
//规格输出
/*产品多图*/
require_once 'goods.class.php';
$goods = new GoodsClass();
if ($product_array['shop_goods_id'] != '') {
$product_array['more_image'] = $goods->getGoodsImage($product_array['shop_goods_id']);
} else {
$product_array['more_image'] = $goods->getGoodsImage($product_array['goods_id']);
}
$this->output('more_image_num', count($product_array['more_image']) + 1);
$this->output('product_array', $product_array);
/*浏览量*/
$goods_click = intval($product_array['goods_click']) + 1;
$this->obj_goods->modifyGoods($goods_click, $condition['goods_id'], "goods_click");
/*推荐产品*/
$commend_array = $this->obj_product->getProductSpecific(array('goods_commend' => 1, 'goods_state' => 1));
$this->output('commend_array', $commend_array);
/*产品属性*/
$goods_attr_body = @unserialize($product_array['goods_attr_body']);
//商品内的属性
include 'goodsClass.class.php';
//载入产品分类文件
$goods_class = new GoodsClassClass();
$goods_type_id = $goods_class->getGoodsClassInfo(array('class_id' => $product_array['class_id']), 'goods_type_id,class_other_attr');
if ($goods_type_id[0] != '') {
include 'goodsType.class.php';
$goods_type = new GoodsTypeClass();
$type_array = $goods_type->getTypeInfo(array('goods_type_id' => $goods_type_id[0]));
/*判断商品类型状态,如果关闭则不执行*/
if ($type_array['goods_type_state'] == 1) {
$attr_array = $goods_type->goodsAttrArray(array('txt_goods_type_id' => $type_array['goods_type_id']));
$goods_attr = array();
$i = 0;
foreach ($attr_array as $val) {
if (!empty($goods_attr_body['class_attr'][$val['attribute_id']])) {
$goods_attr[$i]['title'] = $val['attribute_name'];
$goods_attr[$i]['vaule'] = $goods_attr_body['class_attr'][$val['attribute_id']];
$i++;
}
}
$this->output('goods_attr', $goods_attr);
}
}
/*产品所在分类独有属性*/
if (is_array($goods_type_id['class_other_attr']) and count($goods_type_id['class_other_attr']) > 0) {
$goods_other_attr = array();
foreach ($goods_type_id['class_other_attr'] as $key => $value) {
if (!empty($goods_attr_body['class_other_attr'][$key])) {
$goods_other_attr[] = array('attr_name' => $value, 'attr_value' => $goods_attr_body['class_other_attr'][$key]);
}
}
}
$this->output('goods_other_attr', $goods_other_attr);
/*相关商品*/
if ($product_array['goods_link_goods'] != '') {
if (intval($product_array['shop_goods_id']) == 0) {
$goods_link_goods = $this->obj_goods->ajaxGoodsSearch(array('goods_id_str' => $product_array['goods_link_goods'], 'other_action' => 'modify_link'), '*');
}
$this->output('goods_link_goods', $goods_link_goods);
}
/*相关文章*/
if ($product_array['goods_link_article'] != '') {
include 'article.class.php';
$article = new ArticleClass();
$goods_link_article = $article->ajaxArticleSearch(array('article_id_str' => $product_array['goods_link_article'], 'other_action' => 'modify_link'));
$this->output('goods_link_article', $goods_link_article);
}
/*产品导航条*/
include BasePath . "/share/" . NC_SHOP_DIR . "goods_class_show.php";
$array = array();
foreach ($node_cache as $k => $v) {
if ($v[0] == intval($product_array['class_id'])) {
$array['class_id'] = $v[0];
$array['class_top_id'] = $v[1];
$array['key_id'] = $k;
break;
//.........这里部分代码省略.........
示例2: modifyParment
/**
* 对支付返回结果的处理
*
*/
private function modifyParment()
{
if (intval($this->_input['nc_order_serial']) == 0) {
return false;
}
/*订单信息*/
$order_info = $this->obj_shop_order->getOrderInfo(array('order_serial' => "'" . trim($_GET['nc_order_serial']) . "'"));
if (!$order_info) {
$this->showMessage($this->_lang['shopping_order_error'], $this->_configinfo['websit']['site_url'], 1, 1000);
}
/*调出支付系统的相关内容*/
$pay_type = $this->obj_module_pay->getPayInfo(array('pay_id' => intval($this->_input['shopnccode'])));
if (file_exists("api/payarea/" . $pay_type['pay_area_directory'] . "/" . $pay_type['pay_code'] . ".php")) {
include_once "api/payarea/" . $pay_type['pay_area_directory'] . "/" . $pay_type['pay_code'] . ".php";
$pay_class_name = $pay_type['pay_code'] . 'PayClass';
$out_pay_type = new $pay_class_name();
$result = $out_pay_type->getParmentDo($order_info, $pay_type);
}
if (!$result) {
include_once "order.class.php";
$goods_order = new OrderClass();
include_once 'goods.class.php';
$obj_goods = new GoodsClass();
include "system.class.php";
$email_template = new SystemClass();
include 'shopGoods.class.php';
$obj_shop_goods = new ShopGoodsClass();
include "shopsOrder.class.php";
$goods_shop_order = new ShopsOrderClass();
/*订单已确认*/
$goods_order->orderState(array('action_type' => 'conf_ok', 'order_state' => 1), $order_info['order_id']);
/*订单已支付*/
$goods_order->orderState(array('action_type' => 'pay_ok', 'online_pay' => 1), $order_info['order_id']);
/*以下为虚拟卡自动发货处理*/
$order_array = $goods_order->showGoodsOrder(array('detail_order_id' => $order_info['order_id']));
if (is_array($order_array)) {
/*判断虚拟卡库存是否不足*/
$if_storage = true;
foreach ($order_array as $k => $v) {
/*如果虚拟卡库存足够,取出符合条件的虚拟卡信息*/
if ($v['goods_type'] == 2 && $v['is_send'] == '0') {
/*虚拟卡库存*/
if ($this->_configinfo['websit']['pay_receive_type'] == 1) {
//子店商品库存
$virtual_card_array = $this->obj_product->getProductInfo(array('goods_id' => $v['goods_id']), 'goods_storage');
$virtual_goods_storage = $virtual_card_array['goods_storage'];
$sale_goods_id = $v['sale_goods_id'];
} else {
//主店商品库存
$shop_goods_array = $this->obj_product->getProductInfo(array('goods_id' => $v['goods_id']), 'shop_goods_id');
$virtual_goods_storage = $obj_shop_goods->getShopVirtualCardStorage($shop_goods_array['shop_goods_id']);
$sale_goods_id = $shop_goods_array['shop_goods_id'];
}
if ($v['goods_count'] > $virtual_goods_storage) {
/*库存不足*/
$if_storage = false;
} else {
/*取出本次要出售的虚拟卡*/
$virtual_card_array = array();
$condition = array();
$condition['goods_id'] = $sale_goods_id;
$condition['is_sell'] = '0';
$virtual_card_array = $this->obj_virtual_card->getShopVirtualCardList($condition, '', array(), array(), '*', $v['goods_count']);
/*更新虚拟卡状态*/
$condition_str = '';
foreach ($virtual_card_array as $vv) {
$condition_str .= $vv['card_id'] . ',';
}
$condition_str = ' card_id in (' . trim($condition_str, ',') . ')';
$input_value = array();
$input_value['is_sell'] = '1';
$input_value['order_serial'] = trim($_GET['nc_order_serial']);
$this->obj_virtual_card->updateVirtualCardState($input_value, $condition_str);
/*更新订单虚拟卡商品发货状态*/
if ($this->_configinfo['websit']['pay_receive_type'] == 1) {
$goods_order->updateOrderDetailState(array('is_send' => '1'), $v['order_detail_id']);
} else {
$goods_shop_order->updateOrderDetailState(array('is_send' => '1'), $v['order_detail_id']);
}
/*更新库存*/
if ($this->_configinfo['websit']['pay_receive_type'] == 1) {
$obj_goods->modifyGoods(array('goods_storage' => 'goods_storage-' . $v['goods_count']), $sale_goods_id, 'formula');
} else {
$obj_shop_goods->modifyGoods(array('goods_storage' => 'goods_storage-' . $v['goods_count']), $sale_goods_id, 'formula');
}
/*邮件发货*/
if ($this->_configinfo['websit']['send_virtual_card_mail'] == '1') {
$order_info['goods_name'] = $v['goods_name'];
/*定义发货列表内容*/
$order_list_body = '<li>';
foreach ($virtual_card_array as $vv) {
$order_list_body .= $this->_lang['shoping_virtual_card_number'] . $vv['card_number'];
$order_list_body .= $this->_lang['shoping_virtual_card_password'] . $vv['password'];
$order_list_body .= $this->_lang['shoping_virtual_card_end_time'] . $vv['end_time'];
$order_list_body .= '</li>';
}
//.........这里部分代码省略.........