/** * 查看 * * @author Garbin * @param none * @return void */ function view() { $order_id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (!$order_id) { $this->show_warning('no_such_order'); return; } /* 获取订单信息 */ $model_order =& m('order'); $order_info = $model_order->get(array('conditions' => $order_id, 'join' => 'has_orderextm', 'include' => array('has_ordergoods'))); if (!$order_info) { $this->show_warning('no_such_order'); return; } $order_type =& ot($order_info['extension']); $order_detail = $order_type->get_order_detail($order_id, $order_info); $order_info['group_id'] = 0; if ($order_info['extension'] == 'groupbuy') { $groupbuy_mod =& m('groupbuy'); $groupbuy = $groupbuy_mod->get(array('fields' => 'groupbuy.group_id', 'join' => 'be_join', 'conditions' => "order_id = {$order_info['order_id']} ")); $order_info['group_id'] = $groupbuy['group_id']; } foreach ($order_detail['data']['goods_list'] as $key => $goods) { if (substr($goods['goods_image'], 0, 7) != 'http://') { $order_detail['data']['goods_list'][$key]['goods_image'] = SITE_URL . '/' . $goods['goods_image']; } } $this->assign('order', $order_info); $this->assign($order_detail['data']); $this->display('order.view.html'); }
/** * 查看订单详情 * * @author Garbin * @return void */ function view() { $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0; $model_order =& m('order'); //$order_info = $model_order->get("order_id={$order_id} AND buyer_id=" . $this->visitor->get('user_id')); $order_info = $model_order->get(array('fields' => "*, order.add_time as order_add_time", 'conditions' => "order_id={$order_id} AND buyer_id=" . $this->visitor->get('user_id'), 'join' => 'belongs_to_store')); if (!$order_info) { $this->show_warning('no_such_order'); return; } /* 团购信息 */ if ($order_info['extension'] == 'groupbuy') { $groupbuy_mod =& m('groupbuy'); $group = $groupbuy_mod->get(array('join' => 'be_join', 'conditions' => 'order_id=' . $order_id, 'fields' => 'gb.group_id')); $this->assign('group_id', $group['group_id']); } /* 当前位置 */ $this->_curlocal(LANG::get('member_center'), 'index.php?app=member', LANG::get('my_order'), 'index.php?app=buyer_order', LANG::get('view_order')); /* 当前用户中心菜单 */ $this->_curitem('my_order'); $this->_config_seo('title', Lang::get('member_center') . ' - ' . Lang::get('order_detail')); /* 调用相应的订单类型,获取整个订单详情数据 */ $order_type =& ot($order_info['extension']); $order_detail = $order_type->get_order_detail($order_id, $order_info); foreach ($order_detail['data']['goods_list'] as $key => $goods) { empty($goods['goods_image']) && ($order_detail['data']['goods_list'][$key]['goods_image'] = Conf::get('default_goods_image')); } $this->assign('order', $order_info); $this->assign($order_detail['data']); $this->display('buyer_order.view.html'); }
/** * 查看订单详情 * * @author Garbin * @return void */ function view() { $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0; $model_order =& m('order'); $order_info = $model_order->findAll(array('conditions' => "order_alias.order_id={$order_id} AND seller_id=" . $this->visitor->get('manage_store'), 'join' => 'has_orderextm')); $order_info = current($order_info); if (!$order_info) { $this->show_warning('no_such_order'); return; } /* 当前位置 */ $this->_curlocal(LANG::get('member_center'), 'index.php?app=member', LANG::get('order_manage'), 'index.php?app=seller_order', LANG::get('view_order')); /* 当前用户中心菜单 */ $this->_curitem('order_manage'); $this->assign('page_title', Lang::get('member_center') . ' - ' . Lang::get('detail')); /* 调用相应的订单类型,获取整个订单详情数据 */ $order_type =& ot($order_info['extension']); $order_detail = $order_type->get_order_detail($order_id, $order_info); foreach ($order_detail['data']['goods_list'] as $key => $goods) { empty($goods['goods_image']) && ($order_detail['data']['goods_list'][$key]['goods_image'] = Conf::get('default_goods_image')); } $this->assign('order', $order_info); $this->assign($order_detail['data']); $this->display('seller_order.view.html'); }
/** * 查看订单详情 * * @author Garbin * @return void */ function view() { $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0; $model_order =& m('order'); $order_info = $model_order->findAll(array('conditions' => "order_alias.order_id={$order_id} AND seller_id=" . $this->visitor->get('manage_store'), 'join' => 'has_orderextm')); $order_info = current($order_info); if (!$order_info) { $this->show_warning('no_such_order'); return; } //360cd.cn trans if ($order_info['trans_id']) { $trans_model =& m('trans'); $trans_info = $trans_model->get_trans($order_info['trans_id']); $order_info['trans_info'] = $trans_info['desc']; } //360cd.cn trans /* 团购信息 */ if ($order_info['extension'] == 'groupbuy') { $groupbuy_mod =& m('groupbuy'); $group = $groupbuy_mod->get(array('join' => 'be_join', 'conditions' => 'order_id=' . $order_id, 'fields' => 'gb.group_id')); $this->assign('group_id', $group['group_id']); } /* 当前位置 */ $this->_curlocal(LANG::get('member_center'), 'index.php?app=member', LANG::get('order_manage'), 'index.php?app=seller_order', LANG::get('view_order')); /* 当前用户中心菜单 */ $this->_curitem('order_manage'); $this->_config_seo('title', Lang::get('member_center') . ' - ' . Lang::get('detail')); /* 调用相应的订单类型,获取整个订单详情数据 */ $order_type =& ot($order_info['extension']); $order_detail = $order_type->get_order_detail($order_id, $order_info); $spec_ids = array(); foreach ($order_detail['data']['goods_list'] as $key => $goods) { empty($goods['goods_image']) && ($order_detail['data']['goods_list'][$key]['goods_image'] = Conf::get('default_goods_image')); $spec_ids[] = $goods['spec_id']; } /* 查出最新的相应的货号 */ $model_spec =& m('goodsspec'); $spec_info = $model_spec->find(array('conditions' => $spec_ids, 'fields' => 'sku')); foreach ($order_detail['data']['goods_list'] as $key => $goods) { $order_detail['data']['goods_list'][$key]['sku'] = $spec_info[$goods['spec_id']]['sku']; } $this->assign('order', $order_info); $this->assign($order_detail['data']); $this->display('seller_order.view.html'); }
function _change_order_status($order_id, $order_type, $notify_result) { /* 将验证结果传递给订单类型处理 */ $order_type =& ot($order_type); $order_type->respond_notify($order_id, $notify_result); //响应通知 }
/** * 填写收货人信息,选择配送,支付方式。 * * @author Garbin * @param none * @return void */ function index() { if (!IS_POST) { $goods_info = $this->_get_goods_info(); if ($goods_info === false) { /* 购物车是空的 */ $this->show_warning('goods_empty'); return; } /* 根据商品类型获取对应订单类型 */ $goods_type =& gt($goods_info['type']); $order_type =& ot($goods_type->get_order_type()); /* 显示订单表单 */ $form = $order_type->get_order_form($goods_info['store_id']); if ($form === false) { $this->show_warning($order_type->get_error()); return; } $this->_curlocal(LANG::get('create_order')); $this->assign('page_title', Lang::get('confirm_order_info') . ' - ' . Conf::get('site_title')); $this->assign('goods_info', $goods_info); $this->assign($form['data']); $this->display($form['template']); } else { /* 在此获取生成订单的两个基本要素:用户提交的数据(POST),商品信息(包含商品列表,商品总价,商品总数量,类型),所属店铺 */ $goods_info = $this->_get_goods_info(); if ($goods_info === false) { /* 购物车是空的 */ $this->show_warning('goods_empty'); return; } /* 根据商品类型获取对应的订单类型 */ $goods_type =& gt($goods_info['type']); $order_type =& ot($goods_type->get_order_type()); /* 将这些信息传递给订单类型处理类生成订单(你根据我提供的信息生成一张订单) */ $order_id = $order_type->submit_order(array('goods_info' => $goods_info, 'post' => $_POST)); if (!$order_id) { $this->show_warning($order_type->get_error()); return; } /* 检查是否添加收货人地址 */ if (isset($_POST['save_address']) && intval(trim($_POST['save_address'])) == 1) { $data = array('user_id' => $this->visitor->get('user_id'), 'consignee' => trim($_POST['consignee']), 'region_id' => $_POST['region_id'], 'region_name' => $_POST['region_name'], 'address' => trim($_POST['address']), 'zipcode' => trim($_POST['zipcode']), 'phone_tel' => trim($_POST['phone_tel']), 'phone_mob' => trim($_POST['phone_mob'])); $model_address =& m('address'); $model_address->add($data); } /* 下单完成后清理商品,如清空购物车,或将团购拍卖的状态转为已下单之类的 */ $this->_clear_goods(); /* 发送邮件 */ $model_order =& m('order'); /* 减去商品库存 */ $model_order->change_stock('-', $order_id); /* 获取订单信息 */ $order_info = $model_order->get($order_id); /* 发送事件 */ $feed = array('icon' => 'goods', 'user_id' => $this->visitor->get('user_id'), 'user_name' => addslashes($this->visitor->get('user_name')), 'title' => array('template' => Lang::get('feed_bought_goods_title'), 'data' => array('store' => '<a href="' . SITE_URL . '/index.php?app=store&id=' . $order_info['seller_id'] . '">' . $order_info['seller_name'] . '</a>')), 'body' => array('template' => Lang::get('feed_bought_goods_body'))); $ms =& ms(); $ms->feed->add($feed); $buyer_address = $this->visitor->get('email'); $model_member =& m('member'); $member_info = $model_member->get($goods_info['store_id']); $seller_address = $member_info['email']; /* 发送给买家下单通知 */ $buyer_mail = get_mail('tobuyer_new_order_notify', array('order' => $order_info)); $this->_mailto($buyer_address, addslashes($buyer_mail['subject']), addslashes($buyer_mail['message'])); /* 发送给卖家新订单通知 */ $seller_mail = get_mail('toseller_new_order_notify', array('order' => $order_info)); $this->_mailto($seller_address, addslashes($seller_mail['subject']), addslashes($seller_mail['message'])); /* 更新下单次数 */ $model_goodsstatistics =& m('goodsstatistics'); $goods_ids = array(); foreach ($goods_info['items'] as $goods) { $goods_ids[] = $goods['goods_id']; } $model_goodsstatistics->edit($goods_ids, 'orders=orders+1'); /* 到收银台付款 */ header('Location:index.php?app=cashier&order_id=' . $order_id); } }
function ot_taxonomy_attachment($var, $echo = '') { $attachment_id = ot($var); $attachment_url = wp_get_attachment_url($attachment_id); // returns an array if ($echo == 1) { echo $attachment_url; } else { return $attachment_url; } }
function ot_short($var) { $atts = shortcode_atts(array('id' => '', 'type' => 'image'), $var, 'rj_ot'); if ($atts['type'] == 'image') { $output = ot_attachment($atts['id']); } else { $output = ot($atts['id']); } return $output; }
/** * 填写收货人信息,选择配送,支付方式。 * * @author Garbin * @param none * @return void */ function index() { $goods_info = $this->_get_goods_info(); if ($goods_info === false) { /* 购物车是空的 */ $this->show_warning('goods_empty'); return; } /* 检查库存 */ $goods_beyond = $this->_check_beyond_stock($goods_info['items']); if ($goods_beyond) { $str_tmp = ''; foreach ($goods_beyond as $goods) { $str_tmp .= '<br /><br />' . $goods['goods_name'] . ' ' . $goods['specification'] . ' ' . Lang::get('stock') . ':' . $goods['stock']; } $this->show_warning(sprintf(Lang::get('quantity_beyond_stock'), $str_tmp)); return; } if (!IS_POST) { /* 根据商品类型获取对应订单类型 */ $goods_type =& gt($goods_info['type']); $order_type =& ot($goods_info['otype']); /* 显示订单表单 */ $form = $order_type->get_order_form($goods_info['store_id']); if ($form === false) { $this->show_warning($order_type->get_error()); return; } $this->_curlocal(LANG::get('create_order')); $this->_config_seo('title', Lang::get('confirm_order') . ' - ' . Conf::get('site_title')); $this->assign('goods_info', $goods_info); $this->assign($form['data']); $this->display($form['template']); } else { /* 在此获取生成订单的两个基本要素:用户提交的数据(POST),商品信息(包含商品列表,商品总价,商品总数量,类型),所属店铺 */ $store_id = isset($_GET['store_id']) ? intval($_GET['store_id']) : 0; if ($goods_info === false) { /* 购物车是空的 */ $this->show_warning('goods_empty'); return; } /* 优惠券数据处理 */ if ($goods_info['allow_coupon'] && isset($_POST['coupon_sn']) && !empty($_POST['coupon_sn'])) { $coupon_sn = trim($_POST['coupon_sn']); $coupon_mod =& m('couponsn'); $coupon = $coupon_mod->get(array('fields' => 'coupon.*,couponsn.remain_times', 'conditions' => "coupon_sn.coupon_sn = '{$coupon_sn}' AND coupon.store_id = " . $store_id, 'join' => 'belongs_to_coupon')); if (empty($coupon)) { $this->show_warning('involid_couponsn'); exit; } if ($coupon['remain_times'] < 1) { $this->show_warning("times_full"); exit; } $time = gmtime(); if ($coupon['start_time'] > $time) { $this->show_warning("coupon_time"); exit; } if ($coupon['end_time'] < $time) { $this->show_warning("coupon_expired"); exit; } if ($coupon['min_amount'] > $goods_info['amount']) { $this->show_warning("amount_short"); exit; } unset($time); $goods_info['discount'] = $coupon['coupon_value']; } /* 根据商品类型获取对应的订单类型 */ $goods_type =& gt($goods_info['type']); $order_type =& ot($goods_info['otype']); /* 将这些信息传递给订单类型处理类生成订单(你根据我提供的信息生成一张订单) */ $order_id = $order_type->submit_order(array('goods_info' => $goods_info, 'post' => $_POST)); if (!$order_id) { $this->show_warning($order_type->get_error()); return; } /* 检查是否添加收货人地址 */ if (isset($_POST['save_address']) && intval(trim($_POST['save_address'])) == 1) { $data = array('user_id' => $this->visitor->get('user_id'), 'consignee' => trim($_POST['consignee']), 'region_id' => $_POST['region_id'], 'region_name' => $_POST['region_name'], 'address' => trim($_POST['address']), 'zipcode' => trim($_POST['zipcode']), 'phone_tel' => trim($_POST['phone_tel']), 'phone_mob' => trim($_POST['phone_mob'])); $model_address =& m('address'); $model_address->add($data); } /* 下单完成后清理商品,如清空购物车,或将团购拍卖的状态转为已下单之类的 */ $this->_clear_goods($order_id); /* 发送邮件 */ $model_order =& m('order'); /* 减去商品库存 */ $model_order->change_stock('-', $order_id); /* 获取订单信息 */ $order_info = $model_order->get($order_id); /* 发送事件 */ $feed_images = array(); foreach ($goods_info['items'] as $_gi) { $feed_images[] = array('url' => SITE_URL . '/' . $_gi['goods_image'], 'link' => SITE_URL . '/' . url('app=goods&id=' . $_gi['goods_id'])); } $this->send_feed('order_created', array('user_id' => $this->visitor->get('user_id'), 'user_name' => addslashes($this->visitor->get('user_name')), 'seller_id' => $order_info['seller_id'], 'seller_name' => $order_info['seller_name'], 'store_url' => SITE_URL . '/' . url('app=store&id=' . $order_info['seller_id']), 'images' => $feed_images)); $buyer_address = $this->visitor->get('email'); $model_member =& m('member'); $member_info = $model_member->get($goods_info['store_id']); $seller_address = $member_info['email']; /* 发送给买家下单通知 */ $buyer_mail = get_mail('tobuyer_new_order_notify', array('order' => $order_info)); $this->_mailto($buyer_address, addslashes($buyer_mail['subject']), addslashes($buyer_mail['message'])); /* 发送给卖家新订单通知 */ $seller_mail = get_mail('toseller_new_order_notify', array('order' => $order_info)); $this->_mailto($seller_address, addslashes($seller_mail['subject']), addslashes($seller_mail['message'])); /* 更新下单次数 */ $model_goodsstatistics =& m('goodsstatistics'); $goods_ids = array(); foreach ($goods_info['items'] as $goods) { $goods_ids[] = $goods['goods_id']; } $model_goodsstatistics->edit($goods_ids, 'orders=orders+1'); /* 到收银台付款 */ header('Location:index.php?app=cashier&order_id=' . $order_id); } }
/** * 填写收货人信息,选择配送,支付方式。 * * @author Garbin * @param none * @return void */ function index() { $goods_info = $this->_get_goods_info(); if ($goods_info === false) { /* 购物车是空的 */ $this->show_warning('goods_empty'); return; } /* 检查库存 */ $goods_beyond = $this->_check_beyond_stock($goods_info['items']); if ($goods_beyond) { $str_tmp = ''; foreach ($goods_beyond as $goods) { $str_tmp .= '<br /><br />' . $goods['goods_name'] . ' ' . $goods['specification'] . ' ' . Lang::get('stock') . ':' . $goods['stock']; } $this->show_warning(sprintf(Lang::get('quantity_beyond_stock'), $str_tmp)); return; } /* 检查买家的收货地址,因为用到了运费模板,如果没有收货地址,无法读取运费 tyioocom delivery */ $address_model =& m('address'); if (!$address_model->get('user_id=' . $this->visitor->get('user_id'))) { $this->show_warning('请先添加你的收货地址', '添加地址', 'index.php?app=my_address'); return; } if (!IS_POST) { /* 根据商品类型获取对应订单类型 */ $goods_type =& gt($goods_info['type']); $order_type =& ot($goods_info['otype']); /* 显示订单表单 */ $form = $order_type->get_order_form($goods_info); if ($form === false) { $this->show_warning($order_type->get_error()); return; } $this->_curlocal(LANG::get('create_order')); //by cengnlaeng // (($goods_info['amount'] >= $goods_info['amount_for_free_fee']) && ($goods_info['amount_for_free_fee'] > 0)) && $logic1=true; // $logic2=($goods_info['quantity'] >= $goods_info['acount_for_free_fee']) && ($goods_info['acount_for_free_fee'] > 0); // if($logic1 || $logic2) // { // $logic2 && $title= sprintf(Lang::get('free_acount_ship_title'),$goods_info['acount_for_free_fee']); // $logic1 && $title= sprintf(Lang::get('free_amount_ship_title'),$goods_info['amount_for_free_fee']); // $this->assign('is_free_fee',true); // $this->assign('free_fee_name',$title); // } //end $this->_config_seo('title', Lang::get('confirm_order') . ' - ' . Conf::get('site_title')); $this->assign('coupon_list', $this->get_available_coupon($goods_info['store_id'], $this->visitor->get('user_id'))); $this->assign('goods_info', $goods_info); $this->assign($form['data']); $this->display($form['template']); } else { /* 在此获取生成订单的两个基本要素:用户提交的数据(POST),商品信息(包含商品列表,商品总价,商品总数量,类型),所属店铺 */ $store_id = isset($_GET['store_id']) ? intval($_GET['store_id']) : 0; if ($goods_info === false) { /* 购物车是空的 */ $this->show_warning('goods_empty'); return; } $item_ids = $_POST['ordergoods']; $goods_info = $this->_refresh_goods_info($item_ids, $store_id); /* 优惠券数据处理 */ if ($goods_info['allow_coupon'] && isset($_POST['coupon_sn']) && !empty($_POST['coupon_sn'])) { $coupon_sn = trim($_POST['coupon_sn']); $coupon_mod =& m('couponsn'); $coupon = $coupon_mod->get(array('fields' => 'coupon.*,couponsn.remain_times', 'conditions' => "coupon_sn.coupon_sn = '{$coupon_sn}'", 'join' => 'belongs_to_coupon')); if (empty($coupon)) { $this->show_warning('involid_couponsn'); exit; } if ($coupon['store_id'] > 0) { if ($coupon['store_id'] != $store_id) { $this->show_warning('involid_couponsn'); exit; } } else { //Change by MingFONG at 20150226 if ($coupon['open_agree_item']) { $store_coupon =& m('store_coupon'); $if_can_use = $store_coupon->get('store_id=' . $store_id . ' AND coupon_id=' . $coupon['coupon_id'] . ' AND if_agree=2'); if (empty($if_can_use)) { $this->show_warning('involid_couponsn'); exit; } } //End of Change by MingFONG at 20150226 } if ($coupon['remain_times'] < 1) { $this->show_warning("times_full"); exit; } $time = gmtime(); if ($coupon['start_time'] > $time) { $this->show_warning("coupon_time"); exit; } if ($coupon['end_time'] < $time) { $this->show_warning("coupon_expired"); exit; } if ($coupon['min_amount'] > $goods_info['amount']) { $this->show_warning("amount_short"); exit; } unset($time); $goods_info['discount'] = $coupon['coupon_value']; } /* 根据商品类型获取对应的订单类型 */ $goods_type =& gt($goods_info['type']); $order_type =& ot($goods_info['otype']); /* 将这些信息传递给订单类型处理类生成订单(你根据我提供的信息生成一张订单) */ $order_id = $order_type->submit_order(array('goods_info' => $goods_info, 'post' => $_POST)); if (!$order_id) { $this->show_warning($order_type->get_error()); return; } //360cd.cn trans //360cd.cn $trans_model =& m('trans'); $trans_model->update_order($order_id); //360cd.cn trans /* 检查是否添加收货人地址 */ if (isset($_POST['save_address']) && intval(trim($_POST['save_address'])) == 1) { $data = array('user_id' => $this->visitor->get('user_id'), 'consignee' => trim($_POST['consignee']), 'region_id' => $_POST['region_id'], 'region_name' => $_POST['region_name'], 'address' => trim($_POST['address']), 'zipcode' => trim($_POST['zipcode']), 'phone_tel' => trim($_POST['phone_tel']), 'phone_mob' => trim($_POST['phone_mob'])); $model_address =& m('address'); $model_address->add($data); } /* 下单完成后清理商品,如清空购物车,或将团购拍卖的状态转为已下单之类的 */ $this->_clear_goods($order_id); /* 发送邮件 */ $model_order =& m('order'); /* 减去商品库存 */ $model_order->change_stock('-', $order_id); /* 获取订单信息 */ $order_info = $model_order->get($order_id); /* 发送事件 */ $feed_images = array(); foreach ($goods_info['items'] as $_gi) { $feed_images[] = array('url' => SITE_URL . '/' . $_gi['goods_image'], 'link' => SITE_URL . '/' . url('app=goods&id=' . $_gi['goods_id'])); } $this->send_feed('order_created', array('user_id' => $this->visitor->get('user_id'), 'user_name' => addslashes($this->visitor->get('user_name')), 'seller_id' => $order_info['seller_id'], 'seller_name' => $order_info['seller_name'], 'store_url' => SITE_URL . '/' . url('app=store&id=' . $order_info['seller_id']), 'images' => $feed_images)); $buyer_address = $this->visitor->get('email'); $model_member =& m('member'); $member_info = $model_member->get($goods_info['store_id']); $seller_address = $member_info['email']; /* 发送给买家下单通知 */ $buyer_mail = get_mail('tobuyer_new_order_notify', array('order' => $order_info)); $this->_mailto($buyer_address, addslashes($buyer_mail['subject']), addslashes($buyer_mail['message'])); /* 发送给卖家新订单通知 */ $seller_mail = get_mail('toseller_new_order_notify', array('order' => $order_info)); $this->_mailto($seller_address, addslashes($seller_mail['subject']), addslashes($seller_mail['message'])); /* 更新下单次数 */ $model_goodsstatistics =& m('goodsstatistics'); $goods_ids = array(); foreach ($goods_info['items'] as $goods) { $goods_ids[] = $goods['goods_id']; } $model_goodsstatistics->edit($goods_ids, 'orders=orders+1'); //发送短信给买家 by andcpp $filename = ROOT_PATH . '/data/msg.inc.php'; if (file_exists($filename)) { $mod_msg =& m('msg'); $order_infos = $model_order->get(array('conditions' => $order_info['order_id'], 'join' => 'has_orderextm', 'include' => array('has_ordergoods'))); $order_type1 =& ot($order_infos['extension']); $order_detail = $order_type1->get_order_detail($order_info['order_id'], $order_infos); foreach ($order_detail['data']['goods_list'] as $key => $order_goods) { $content .= $order_goods['goods_name'] . $order_goods['quantity'] . Lang::get('fen') . ','; } $name = $order_infos['consignee']; $address = $order_infos['address']; $phone = $order_infos['phone_mob']; $user_id = $order_info['seller_id']; $row_msg = $mod_msg->get(array('conditions' => 'msg.user_id=' . $user_id, 'join' => 'belongs_to_user', 'fields' => 'this.*,phone_mob')); $mobile = $row_msg['phone_mob']; //手机号 $smsText = sprintf(Lang::get('sms_buy'), $content, $name, $address, $phone); $checked_functions = $functions = array(); $functions = $this->_get_msg_functions(); $tmp = explode(',', $row_msg['functions']); if ($functions) { foreach ($functions as $func) { $checked_functions[$func] = in_array($func, $tmp); } } if ($row_msg['state'] == 1 && $checked_functions['buy'] == 1 && $row_msg['num'] > 0 && !empty($mobile) && !empty($smsText)) { $this->Sms_Get('SMS_Send', $mobile, $smsText, $user_id); } } //end by psmb /* 到收银台付款 */ header('Location:index.php?app=cashier&order_id=' . $order_id); } }
function ot_user_image_by_uid($id, $var, $echo = '', $size = 'full') { $attachment_id = ot($id, $var); $image_attributes = wp_get_attachment_image_src($attachment_id, $size); // returns an array if ($echo == 1) { echo $image_attributes[0]; } else { return $image_attributes[0]; } }
function change_address() { $goods_info = $this->_get_carts_info(); //获取所有提交过来的产品信息 $stores_id = $this->get_stores($goods_info); $order_type =& ot($goods_info['otype']); //是否是团购 $addr_id = isset($_POST['addr_id']) ? intval($_POST['addr_id']) : 0; if (!$addr_id) { $this->_error("没有该收获地址"); } $store_num = count($stores_id); $address_model =& m('address'); $address = $address_model->get("user_id=" . $this->visitor->get('user_id') . " and addr_id=" . $addr_id); $region_idd = $address['region_id']; $shipping_methods = array(); /* 显示订单表单 */ $form = $order_type->get_order_form2($stores_id, $_POST['addr_id']); //分别取出各个店铺的信息配送信息 foreach ($goods_info as $id => $val) { if ($id > 0) { $shipping_methods[$id] = $form['data'][$id]['shipping_methods']; foreach ($shipping_methods[$id] as $sid => $val) { //循环配送信息 $cod_regions = unserialize($val['cod_regions']); if (is_array($cod_regions) && !empty($cod_regions)) { /* 取得支持货到付款地区的所有下级地区 */ $all_regions = array(); $model_region =& m('region'); foreach ($cod_regions as $region_id => $region_name) { $all_regions = array_merge($all_regions, $model_region->get_descendant($region_id)); } /* 查看订单中指定的地区是否在可货到付款的地区列表中,如果不在,则不显示货到付款的付款方式 */ if (!in_array($region_idd, $all_regions)) { unset($shipping_methods[$id][$sid]); } else { $yunfei[$id] = $val['first_price']; //没有被删除的配送方式id $shipp_fee[] = price_format($val['first_price']); //返还的运费数组 unset($stores_id[$id]); } } else { unset($shipping_methods[$id][$sid]); } } $total[] = price_format($goods_info[$id]['amount'] + $yunfei[$id]); } } $sto =& m("store"); foreach ($stores_id as $id => $val) { $store = $sto->get("store_id=" . $id); $noshipping[] = $store['store_name']; } if (count($yunfei) != $store_num) { $this->json_results(array('done' => false, 'noshipping' => $noshipping)); return; } foreach ($yunfei as $k => $val) { $yun += floatval($val); //计算总运费 } $subtotal = $yun + $goods_info['subtotal']; //计算总价格 $this->json_results(array('done' => true, 'subtotal' => price_format($subtotal), 'yuntotal' => price_format($yun), 'yunfei' => $shipp_fee, 'total' => $total)); }
function wuliu() { $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0; $cache_server =& cache_server(); $key = "page_of_order_wuliu_" . $this->visitor->get('user_id') . "_" . $val['order_id']; $shipping = $cache_server->get($key); $model_order =& m('order'); $express =& m("express"); $order_info = $model_order->get(array('fields' => "*, order.add_time as order_add_time", 'conditions' => "order_id={$order_id} AND buyer_id=" . $this->visitor->get('user_id'), 'join' => 'belongs_to_store')); $shipp = $order_info['shipping_name']; $info = $express->get("express_name='{$shipp}'"); $order_info['express_phone'] = $info['express_phone']; if (!$order_info) { $this->show_warning('no_such_order'); return; } $order_type =& ot($order_info['extension']); $order_detail = $order_type->get_order_detail($order_id, $order_info); if ($shipping === false) { $shipping = express_info($shipping, $order_info['invoice_no']); $shipping = json_decode($shipping, true); $cache_server->set($key, $shipping, 1440); } $order_type =& ot($order_info['extension']); $order_detail = $order_type->get_order_detail($order_id, $order_info); // foreach ($order_detail['data']['goods_list'] as $key => &$goods) // { // empty($goods['goods_image']) && $order_detail['data']['goods_list'][$key]['goods_image'] = Conf::get('default_goods_image'); // $goods['goods_amount']=$goods['quantity']*$goods['price']; // } /* 当前位置 */ $this->_curlocal(LANG::get('member_center'), 'index.php?app=member', LANG::get('my_order'), 'index.php?app=buyer_order', "物流中心"); /* 当前用户中心菜单 */ $this->_curitem('my_order'); $this->assign('order', $order_info); $this->assign($order_detail['data']); $this->assign("wuliu", $shipping['data']); $this->_config_seo('title', Lang::get('member_center') . ' - ' . "物流中心"); if (is_wap()) { $this->assign("title", "物流中心"); } $this->display("pr_order.wuliu.html"); }