/** * 咨询管理 */ public function consultingOp() { $condition = array(); if (uk86_chksubmit()) { $member_name = trim($_GET['member_name']); if ($member_name != '') { $condition['member_name'] = array('like', '%' . $member_name . '%'); Tpl::output('member_name', $member_name); } $consult_content = trim($_GET['consult_content']); if ($consult_content != '') { $condition['consult_content'] = array('like', '%' . $consult_content . '%'); Tpl::output('consult_content', $consult_content); } $ctid = intval($_GET['ctid']); if ($ctid > 0) { $condition['ct_id'] = $ctid; Tpl::output('ctid', $ctid); } } $model_consult = Model('consult'); $consult_list = $model_consult->getConsultList($condition, '*', 0, 10); Tpl::output('show_page', $model_consult->showpage()); Tpl::output('consult_list', $consult_list); // 咨询类型 $consult_type = uk86_rkcache('consult_type', true); Tpl::output('consult_type', $consult_type); Tpl::showpage('consulting.index'); }
public function __construct() { parent::__construct(); Uk86Language::uk86_read('stat'); uk86_import('function.statistics'); uk86_import('function.datehelper'); $model = Model('stat'); //存储参数 $this->search_arr = $_REQUEST; //处理搜索时间 if (in_array($_REQUEST['op'], array('hotrank', 'storesales'))) { $this->search_arr = $model->dealwithSearchTime($this->search_arr); //获得系统年份 $year_arr = uk86_getSystemYearArr(); //获得系统月份 $month_arr = uk86_getSystemMonthArr(); //获得本月的周时间段 $week_arr = uk86_getMonthWeekArr($this->search_arr['week']['current_year'], $this->search_arr['week']['current_month']); Tpl::output('year_arr', $year_arr); Tpl::output('month_arr', $month_arr); Tpl::output('week_arr', $week_arr); } Tpl::output('search_arr', $this->search_arr); //店铺分类 $this->store_class = uk86_rkcache('store_class', true); Tpl::output('store_class', $this->store_class); }
public function __construct() { parent::__construct(); //读取语言包 Uk86Language::uk86_read('member_groupbuy,home_cart_index'); //检查抢购功能是否开启 if (intval(C('groupbuy_allow')) !== 1) { uk86_showMessage(Uk86Language::uk86_get('groupbuy_unavailable'), uk86_urlShop(), '', 'error'); } //分类导航 $nav_link = array(0 => array('title' => Uk86Language::uk86_get('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => Uk86Language::uk86_get('nc_groupbuy'))); Tpl::output('nav_link_list', $nav_link); // Tpl::setLayout('home_groupbuy_layout'); Tpl::output('index_sign', 'groupbuy'); if ($_GET['op'] != 'groupbuy_detail') { // 抢购价格区间 $this->groupbuy_price = uk86_rkcache('groupbuy_price', true); Tpl::output('price_list', $this->groupbuy_price); $model_groupbuy = Model('groupbuy'); // 线上抢购分类 $this->groupbuy_classes = $model_groupbuy->getGroupbuyClasses(); Tpl::output('groupbuy_classes', $this->groupbuy_classes); // 虚拟抢购分类 $this->groupbuy_vr_classes = $model_groupbuy->getGroupbuyVrClasses(); Tpl::output('groupbuy_vr_classes', $this->groupbuy_vr_classes); // 虚拟抢购城市 $this->groupbuy_vr_cities = $model_groupbuy->getGroupbuyVrCities(); Tpl::output('groupbuy_vr_cities', $this->groupbuy_vr_cities); Tpl::output('city_name', $this->groupbuy_vr_cities['name'][uk86_cookie('city_id')]); } }
public function uk86_send($param = array()) { $msg_tpl = uk86_rkcache('store_msg_tpl', true); if (!isset($msg_tpl[$this->code]) || $this->store_id <= 0) { return false; } $tpl_info = $msg_tpl[$this->code]; $setting_info = Model('store_msg_setting')->getStoreMsgSettingInfo(array('smt_code' => $this->code, 'store_id' => $this->store_id)); // 发送站内信 if ($tpl_info['smt_message_switch'] && ($tpl_info['smt_message_forced'] || $setting_info['sms_message_switch'])) { $message = uk86_ncReplaceText($tpl_info['smt_message_content'], $param); $this->uk86_sendMessage($message); } // 发送短消息 if ($tpl_info['smt_short_switch'] && $setting_info['sms_short_number'] != '' && ($tpl_info['smt_short_forced'] || $setting_info['sms_short_switch'])) { $param['site_name'] = C('site_name'); $message = uk86_ncReplaceText($tpl_info['smt_short_content'], $param); $this->uk86_sendShort($setting_info['sms_short_number'], $message); } // 发送邮件 if ($tpl_info['smt_mail_switch'] && $setting_info['sms_mail_number'] != '' && ($tpl_info['smt_mail_forced'] || $setting_info['sms_mail_switch'])) { $param['site_name'] = C('site_name'); $param['mail_send_time'] = date('Y-m-d H:i:s'); $subject = uk86_ncReplaceText($tpl_info['smt_mail_subject'], $param); $message = uk86_ncReplaceText($tpl_info['smt_mail_content'], $param); $this->uk86_sendMail($setting_info['sms_mail_number'], $subject, $message); } }
/** * 根据编号查询快递列表 */ public function getExpressListByID($id = null) { $express_list = uk86_rkcache('express', true); if (!empty($id)) { $id_array = explode(',', $id); foreach ($express_list as $key => $value) { if (!in_array($key, $id_array)) { unset($express_list[$key]); } } return $express_list; } else { return array(); } }
/** * get setting */ private static function uk86_parse_conf(&$setting_config) { $nc_config = $GLOBALS['config']; if (is_array($nc_config['db']['slave']) && !empty($nc_config['db']['slave'])) { $dbslave = $nc_config['db']['slave']; $sid = array_rand($dbslave); $nc_config['db']['slave'] = $dbslave[$sid]; } else { $nc_config['db']['slave'] = $nc_config['db'][1]; } $nc_config['db']['master'] = $nc_config['db'][1]; $setting_config = $nc_config; $setting = ($setting = uk86_rkcache('setting')) ? $setting : uk86_rkcache('setting', true); $setting['uk86_version'] = 'Copyright 2015 优康商城版权所有'; $setting_config = array_merge_recursive($setting, $nc_config); }
/** * 构造函数 */ public function __construct() { /** * 读取通用、布局的语言包 */ Uk86Language::uk86_read('common'); /** * 设置布局文件内容 */ Tpl::setLayout('delivery_layout'); /** * SEO */ $this->SEO(); /** * 获取导航 */ Tpl::output('nav_list', uk86_rkcache('nav', true)); }
/** * 生成表结构信息 * * @param string $table * @return */ public function tableInfo($table) { if (empty($table)) { return false; } //只取主键,find(2)等自动匹配主键时使用 if (C('cache_open')) { $this->fields = uk86_rkcache('field/_pk', __CLASS__ . '::fetchTablePkArray'); } else { if (file_exists(BASE_DATA_PATH . '/cache/fields/_pk.php')) { $this->fields = (require BASE_DATA_PATH . '/cache/fields/_pk.php'); } else { $_pk_array = self::fetchTablePkArray(); F('_pk', $_pk_array, 'cache/fields'); $this->fields = $_pk_array; } } return $this->fields[$table]; }
public function uk86_send($param = array()) { $msg_tpl = uk86_rkcache('member_msg_tpl', true); if (!isset($msg_tpl[$this->code]) || $this->member_id <= 0) { return false; } $tpl_info = $msg_tpl[$this->code]; $setting_info = Model('member_msg_setting')->getMemberMsgSettingInfo(array('mmt_code' => $this->code, 'member_id' => $this->member_id), 'is_receive'); if (empty($setting_info) || $setting_info['is_receive']) { // 发送站内信 if ($tpl_info['mmt_message_switch']) { $message = uk86_ncReplaceText($tpl_info['mmt_message_content'], $param); $this->uk86_sendMessage($message); } // 发送短消息 if ($tpl_info['mmt_short_switch']) { $this->uk86_getMemberInfo(); if (!empty($this->mobile)) { $this->member_info['member_mobile'] = $this->mobile; } if ($this->member_info['member_mobile_bind'] && !empty($this->member_info['member_mobile'])) { $param['site_name'] = C('site_name'); $message = uk86_ncReplaceText($tpl_info['mmt_short_content'], $param); $this->uk86_sendShort($this->member_info['member_mobile'], $message); } } // 发送邮件 if ($tpl_info['mmt_mail_switch']) { $this->uk86_getMemberInfo(); if (!empty($this->email)) { $this->member_info['member_email'] = $this->email; } if ($this->member_info['member_email_bind'] && !empty($this->member_info['member_email'])) { $param['site_name'] = C('site_name'); $param['mail_send_time'] = date('Y-m-d H:i:s'); $subject = uk86_ncReplaceText($tpl_info['mmt_mail_subject'], $param); $message = uk86_ncReplaceText($tpl_info['mmt_mail_content'], $param); $this->uk86_sendMail($this->member_info['member_email'], $subject, $message); } } } }
/** * 获取自营店铺的ID * * @param boolean $bind_all_gc = false 是否只获取绑定全部类目的自营店 默认否(即全部自营店) * @return array */ public function getOwnShopIds($bind_all_gc = false) { $data = $this->ownShopIds; // 属性为空则取缓存 if (!$data) { $data = uk86_rkcache('own_shop_ids'); // 缓存为空则查库 if (!$data) { $data = array(); $all_own_shops = $this->table('store')->field('store_id,bind_all_gc')->where(array('is_own_shop' => 1))->select(); foreach ((array) $all_own_shops as $v) { $data[$v['store_id']] = (int) (bool) $v['bind_all_gc']; } // 写入缓存 uk86_wkcache('own_shop_ids', $data); } // 写入属性 $this->ownShopIds = $data; } return array_keys($bind_all_gc ? array_filter($data) : $data); }
/** * 商品咨询列表页 */ public function consult_listOp() { $consult = Model('consult'); $list_consult = array(); $where = array(); if (trim($_GET['type']) == 'to_reply') { $where['consult_reply'] = array('eq', ''); } elseif (trim($_GET['type'] == 'replied')) { $where['consult_reply'] = array('neq', ''); } if (intval($_GET['ctid']) > 0) { $where['ct_id'] = intval($_GET['ctid']); } $where['store_id'] = $_SESSION['store_id']; $list_consult = $consult->getConsultList($where, '*', 0, 10); Tpl::output('show_page', $consult->showpage()); Tpl::output('list_consult', $list_consult); // 咨询类型 $consult_type = uk86_rkcache('consult_type', true); Tpl::output('consult_type', $consult_type); $_GET['type'] = empty($_GET['type']) ? 'consult_list' : $_GET['type']; self::profile_menu('consult', $_GET['type']); Tpl::showpage('store_consult_manage'); }
/** * 退货记录查看页 * */ public function viewOp() { $model_refund = Model('refund_return'); $condition = array(); $condition['buyer_id'] = $_SESSION['member_id']; $condition['refund_id'] = intval($_GET['return_id']); $return_list = $model_refund->getReturnList($condition); $return = $return_list[0]; Tpl::output('return', $return); $express_list = uk86_rkcache('express', true); if ($return['express_id'] > 0 && !empty($return['invoice_no'])) { Tpl::output('return_e_name', $express_list[$return['express_id']]['e_name']); } $info['buyer'] = array(); if (!empty($return['pic_info'])) { $info = unserialize($return['pic_info']); } Tpl::output('pic_list', $info['buyer']); $condition = array(); $condition['order_id'] = $return['order_id']; $model_refund->getRightOrderList($condition, $return['order_goods_id']); Tpl::showpage('member_return_view'); }
/** * Level introduction */ public function level_intrOp() { // 圈子信息 $this->circleInfo(); // 圈主和管理信息 $this->manageList(); // 会员信息 $this->memberInfo(); // breadcrumb navigation $this->breadcrumd(L('level_introduction')); // member level $ml_info = Model()->table('circle_ml')->find($this->c_id); $mld_array = uk86_rkcache('circle_level') ? uk86_rkcache('circle_level') : uk86_rkcache('circle_level', true); if (empty($ml_info)) { $ml_info['ml_1'] = $mld_array['1']['mld_name']; $ml_info['ml_2'] = $mld_array['2']['mld_name']; $ml_info['ml_3'] = $mld_array['3']['mld_name']; $ml_info['ml_4'] = $mld_array['4']['mld_name']; $ml_info['ml_5'] = $mld_array['5']['mld_name']; $ml_info['ml_6'] = $mld_array['6']['mld_name']; $ml_info['ml_7'] = $mld_array['7']['mld_name']; $ml_info['ml_8'] = $mld_array['8']['mld_name']; $ml_info['ml_9'] = $mld_array['9']['mld_name']; $ml_info['ml_10'] = $mld_array['10']['mld_name']; $ml_info['ml_11'] = $mld_array['11']['mld_name']; $ml_info['ml_12'] = $mld_array['12']['mld_name']; $ml_info['ml_13'] = $mld_array['13']['mld_name']; $ml_info['ml_14'] = $mld_array['14']['mld_name']; $ml_info['ml_15'] = $mld_array['15']['mld_name']; $ml_info['ml_16'] = $mld_array['16']['mld_name']; } Tpl::output('ml_info', $ml_info); Tpl::output('mld_array', $mld_array); Tpl::showpage('group.level'); }
/** * 详细页右侧订单信息 * * @param * @return array */ public function getRightOrderList($order_condition, $order_goods_id = 0) { $model_order = Model('order'); $order_info = $model_order->getOrderInfo($order_condition, array('order_common', 'store')); Tpl::output('order', $order_info); $order_id = $order_info['order_id']; $store = $order_info['extend_store']; Tpl::output('store', $store); $order_common = $order_info['extend_order_common']; Tpl::output('order_common', $order_common); if ($order_common['shipping_express_id'] > 0) { $express = uk86_rkcache('express', true); Tpl::output('e_code', $express[$order_common['shipping_express_id']]['e_code']); Tpl::output('e_name', $express[$order_common['shipping_express_id']]['e_name']); } $condition = array(); $condition['order_id'] = $order_id; if ($order_goods_id > 0) { $condition['rec_id'] = $order_goods_id; //订单商品表编号 } $goods_list = $model_order->getOrderGoodsList($condition); Tpl::output('goods_list', $goods_list); $order_info['goods_list'] = $goods_list; return $order_info; }
/** * circle member level */ public function levelOp() { // Circle information $this->circleInfo(); // Membership information $this->circleMemberInfo(); // Members to join the circle list $this->memberJoinCircle(); if (uk86_chksubmit()) { $insert = array(); $insert['circle_id'] = $this->c_id; $mld_array = uk86_rkcache('circle_level') ? uk86_rkcache('circle_level') : uk86_rkcache('circle_level', true); if ($_POST['levelset'] == 'custom') { $insert['mlref_id'] = null; $insert['ml_1'] = $_POST['levelname']['1'] != '' ? $_POST['levelname']['1'] : $mld_array['1']['mld_name']; $insert['ml_2'] = $_POST['levelname']['2'] != '' ? $_POST['levelname']['2'] : $mld_array['2']['mld_name']; $insert['ml_3'] = $_POST['levelname']['3'] != '' ? $_POST['levelname']['3'] : $mld_array['3']['mld_name']; $insert['ml_4'] = $_POST['levelname']['4'] != '' ? $_POST['levelname']['4'] : $mld_array['4']['mld_name']; $insert['ml_5'] = $_POST['levelname']['5'] != '' ? $_POST['levelname']['5'] : $mld_array['5']['mld_name']; $insert['ml_6'] = $_POST['levelname']['6'] != '' ? $_POST['levelname']['6'] : $mld_array['6']['mld_name']; $insert['ml_7'] = $_POST['levelname']['7'] != '' ? $_POST['levelname']['7'] : $mld_array['7']['mld_name']; $insert['ml_8'] = $_POST['levelname']['8'] != '' ? $_POST['levelname']['8'] : $mld_array['8']['mld_name']; $insert['ml_9'] = $_POST['levelname']['9'] != '' ? $_POST['levelname']['9'] : $mld_array['9']['mld_name']; $insert['ml_10'] = $_POST['levelname']['10'] != '' ? $_POST['levelname']['10'] : $mld_array['10']['mld_name']; $insert['ml_11'] = $_POST['levelname']['11'] != '' ? $_POST['levelname']['11'] : $mld_array['11']['mld_name']; $insert['ml_12'] = $_POST['levelname']['12'] != '' ? $_POST['levelname']['12'] : $mld_array['12']['mld_name']; $insert['ml_13'] = $_POST['levelname']['13'] != '' ? $_POST['levelname']['13'] : $mld_array['13']['mld_name']; $insert['ml_14'] = $_POST['levelname']['14'] != '' ? $_POST['levelname']['14'] : $mld_array['14']['mld_name']; $insert['ml_15'] = $_POST['levelname']['15'] != '' ? $_POST['levelname']['15'] : $mld_array['15']['mld_name']; $insert['ml_16'] = $_POST['levelname']['16'] != '' ? $_POST['levelname']['16'] : $mld_array['16']['mld_name']; } else { $levelset = intval($_POST['levelset']); if ($levelset) { $mlref_info = Model()->table('circle_mlref')->find($levelset); } if (!empty($mlref_info)) { $insert['mlref_id'] = $mlref_info['mlref_id']; $insert['ml_1'] = $mlref_info['mlref_1']; $insert['ml_2'] = $mlref_info['mlref_2']; $insert['ml_3'] = $mlref_info['mlref_3']; $insert['ml_4'] = $mlref_info['mlref_4']; $insert['ml_5'] = $mlref_info['mlref_5']; $insert['ml_6'] = $mlref_info['mlref_6']; $insert['ml_7'] = $mlref_info['mlref_7']; $insert['ml_8'] = $mlref_info['mlref_8']; $insert['ml_9'] = $mlref_info['mlref_9']; $insert['ml_10'] = $mlref_info['mlref_10']; $insert['ml_11'] = $mlref_info['mlref_11']; $insert['ml_12'] = $mlref_info['mlref_12']; $insert['ml_13'] = $mlref_info['mlref_13']; $insert['ml_14'] = $mlref_info['mlref_14']; $insert['ml_15'] = $mlref_info['mlref_15']; $insert['ml_16'] = $mlref_info['mlref_16']; } else { $insert['mlref_id'] = 0; $insert['ml_1'] = $mld_array['1']['mld_name']; $insert['ml_2'] = $mld_array['2']['mld_name']; $insert['ml_3'] = $mld_array['3']['mld_name']; $insert['ml_4'] = $mld_array['4']['mld_name']; $insert['ml_5'] = $mld_array['5']['mld_name']; $insert['ml_6'] = $mld_array['6']['mld_name']; $insert['ml_7'] = $mld_array['7']['mld_name']; $insert['ml_8'] = $mld_array['8']['mld_name']; $insert['ml_9'] = $mld_array['9']['mld_name']; $insert['ml_10'] = $mld_array['10']['mld_name']; $insert['ml_11'] = $mld_array['11']['mld_name']; $insert['ml_12'] = $mld_array['12']['mld_name']; $insert['ml_13'] = $mld_array['13']['mld_name']; $insert['ml_14'] = $mld_array['14']['mld_name']; $insert['ml_15'] = $mld_array['15']['mld_name']; $insert['ml_16'] = $mld_array['16']['mld_name']; } } $rs = Model('circle_level')->levelInsert($insert, true); showDialog(L('nc_common_op_succ'), 'reload', 'succ'); } $model = Model(); // Defaule Member Title list $mldefault_list = uk86_rkcache('circle_level') ? uk86_rkcache('circle_level') : uk86_rkcache('circle_level', true); if (!empty($mldefault_list)) { $mld_array = array(); foreach ($mldefault_list as $val) { $mld_array[$val['mld_id']]['name'] = $val['mld_name']; $mld_array[$val['mld_id']]['exp'] = $val['mld_exp']; } // Refer to the Member Title list $mlref_list = $model->table('circle_mlref')->where(array('mlref_status' => 1))->select(); // tidy if (!empty($mlref_list)) { $mlr_array = array(); foreach ($mlref_list as $val) { $mlr_array[$val['mlref_id']]['name'] = $val['mlref_name']; $mlr_array[$val['mlref_id']]['info'][1]['name'] = $val['mlref_1']; $mlr_array[$val['mlref_id']]['info'][2]['name'] = $val['mlref_2']; $mlr_array[$val['mlref_id']]['info'][3]['name'] = $val['mlref_3']; $mlr_array[$val['mlref_id']]['info'][4]['name'] = $val['mlref_4']; $mlr_array[$val['mlref_id']]['info'][5]['name'] = $val['mlref_5']; $mlr_array[$val['mlref_id']]['info'][6]['name'] = $val['mlref_6']; $mlr_array[$val['mlref_id']]['info'][7]['name'] = $val['mlref_7']; $mlr_array[$val['mlref_id']]['info'][8]['name'] = $val['mlref_8']; $mlr_array[$val['mlref_id']]['info'][9]['name'] = $val['mlref_9']; $mlr_array[$val['mlref_id']]['info'][10]['name'] = $val['mlref_10']; $mlr_array[$val['mlref_id']]['info'][11]['name'] = $val['mlref_11']; $mlr_array[$val['mlref_id']]['info'][12]['name'] = $val['mlref_12']; $mlr_array[$val['mlref_id']]['info'][13]['name'] = $val['mlref_13']; $mlr_array[$val['mlref_id']]['info'][14]['name'] = $val['mlref_14']; $mlr_array[$val['mlref_id']]['info'][15]['name'] = $val['mlref_15']; $mlr_array[$val['mlref_id']]['info'][16]['name'] = $val['mlref_16']; } } Tpl::output('mld_array', $mld_array); Tpl::output('mlr_array', $mlr_array); } $ml_info = $model->table('circle_ml')->find($this->c_id); if (!empty($ml_info)) { $ml_array = array(); $cl_array = array(); // checked level $ml_array['mlref_id'] = $ml_info['mlref_id']; if ($ml_info['mlref_id'] == null) { $ml_array['info'][1]['name'] = $ml_info['ml_1']; $ml_array['info'][2]['name'] = $ml_info['ml_2']; $ml_array['info'][3]['name'] = $ml_info['ml_3']; $ml_array['info'][4]['name'] = $ml_info['ml_4']; $ml_array['info'][5]['name'] = $ml_info['ml_5']; $ml_array['info'][6]['name'] = $ml_info['ml_6']; $ml_array['info'][7]['name'] = $ml_info['ml_7']; $ml_array['info'][8]['name'] = $ml_info['ml_8']; $ml_array['info'][9]['name'] = $ml_info['ml_9']; $ml_array['info'][10]['name'] = $ml_info['ml_10']; $ml_array['info'][11]['name'] = $ml_info['ml_11']; $ml_array['info'][12]['name'] = $ml_info['ml_12']; $ml_array['info'][13]['name'] = $ml_info['ml_13']; $ml_array['info'][14]['name'] = $ml_info['ml_14']; $ml_array['info'][15]['name'] = $ml_info['ml_15']; $ml_array['info'][16]['name'] = $ml_info['ml_16']; } Tpl::output('ml_info', $ml_array); } $this->sidebar_menu('level'); Tpl::showpage('group_manage_memberlevel'); }
/** * 获得推荐的热门卡券包列表 * @param int $num 查询条数 */ public function getRecommendTemplate($num) { //查询店铺分类 $store_class = uk86_rkcache('store_class', true); //查询推荐的热门卡券包列表 $where = array(); $where['voucher_t_recommend'] = '1'; $where['voucher_t_state'] = $this->templatestate_arr['usable'][0]; $where['voucher_t_end_date'] = array('gt', time()); $recommend_voucher = $this->getVoucherTemplateList($where, $field = '*', $num, 0, 'voucher_t_id desc'); if ($recommend_voucher) { foreach ($recommend_voucher as $k => $v) { $v['voucher_t_sc_name'] = $store_class[$v['voucher_t_sc_id']]['sc_name']; $recommend_voucher[$k] = $v; } } return $recommend_voucher; }
/** * 圈子管理 */ public function indexOp() { // 圈子信息 $this->circleInfo(); // 会员信息 $this->circleMemberInfo(); if ($this->identity == 2) { @header("location: " . CIRCLE_SITE_URL . '/index.php?act=manage&op=applying&c_id=' . $this->c_id); } // 会员加入圈子列表 $this->memberJoinCircle(); $model = Model(); if (uk86_chksubmit()) { $update = array(); $update['circle_id'] = $this->c_id; // 上传图片 if (!empty($_FILES['c_img']['name'])) { $upload = new Uk86UploadFile(); $upload->uk86_set('default_dir', ATTACH_CIRCLE . '/group'); $upload->uk86_set('thumb_width', 120); $upload->uk86_set('thumb_height', 120); $upload->uk86_set('thumb_ext', '_120x120'); $upload->uk86_set('ifremove', true); $result = $upload->uk86_upfile('c_img'); if ($result) { $update['circle_img'] = $upload->thumb_image; $model->table('circle')->update($update); } else { showDialog($upload->error); } } $update['circle_desc'] = $_POST['c_desc']; $update['circle_notice'] = $_POST['c_notice']; $update['circle_joinaudit'] = $_POST['c_joinaudit']; if ($_POST['c_mapply'] == 1) { $update['mapply_open'] = 1; $update['mapply_ml'] = $_POST['c_ml']; } else { $update['mapply_open'] = 0; $update['mapply_ml'] = 0; $update['new_mapplycount'] = 0; // Delete the application information $model->table('circle_mapply')->where(array('circle_id' => $this->c_id))->delete(); } $model->table('circle')->update($update); showDialog(L('nc_common_op_succ'), 'reload', 'succ'); } $circle_info = $model->table('circle')->find($this->c_id); Tpl::output('circle_info', $circle_info); // member level $ml_info = $model->table('circle_ml')->find($this->c_id); if (empty($ml_info)) { $mld_array = uk86_rkcache('circle_level') ? uk86_rkcache('circle_level') : uk86_rkcache('circle_level', true); $ml_info['ml_1'] = $mld_array['1']['mld_name']; $ml_info['ml_2'] = $mld_array['2']['mld_name']; $ml_info['ml_3'] = $mld_array['3']['mld_name']; $ml_info['ml_4'] = $mld_array['4']['mld_name']; $ml_info['ml_5'] = $mld_array['5']['mld_name']; $ml_info['ml_6'] = $mld_array['6']['mld_name']; $ml_info['ml_7'] = $mld_array['7']['mld_name']; $ml_info['ml_8'] = $mld_array['8']['mld_name']; $ml_info['ml_9'] = $mld_array['9']['mld_name']; $ml_info['ml_10'] = $mld_array['10']['mld_name']; $ml_info['ml_11'] = $mld_array['11']['mld_name']; $ml_info['ml_12'] = $mld_array['12']['mld_name']; $ml_info['ml_13'] = $mld_array['13']['mld_name']; $ml_info['ml_14'] = $mld_array['14']['mld_name']; $ml_info['ml_15'] = $mld_array['15']['mld_name']; $ml_info['ml_16'] = $mld_array['16']['mld_name']; } Tpl::output('ml_info', $ml_info); $this->sidebar_menu('index'); Tpl::showpage('group_manage_index'); }
/** * 产品咨询 */ public function consulting_listOp() { $goods_id = intval($_GET['goods_id']); if ($goods_id <= 0) { uk86_showMessage(Uk86Language::uk86_get('wrong_argument'), '', 'html', 'error'); } // 商品详细信息 $model_goods = Model('goods'); $goods_info = $model_goods->getGoodsInfoByID($goods_id, '*'); // 验证商品是否存在 if (empty($goods_info)) { uk86_showMessage(L('goods_index_no_goods'), '', 'html', 'error'); } Tpl::output('goods', $goods_info); $this->getStoreInfo($goods_info['store_id']); // 当前位置导航 $nav_link_list = Model('goods_class')->getGoodsClassNav($goods_info['gc_id'], 0); $nav_link_list[] = array('title' => $goods_info['goods_name'], 'link' => uk86_urlShop('goods', 'index', array('goods_id' => $goods_id))); $nav_link_list[] = array('title' => '商品咨询'); Tpl::output('nav_link_list', $nav_link_list); //得到商品咨询信息 $model_consult = Model('consult'); $where = array(); $where['goods_id'] = $goods_id; if (intval($_GET['ctid']) > 0) { $where['ct_id'] = intval($_GET['ctid']); } $consult_list = $model_consult->getConsultList($where, '*', 0, 20); Tpl::output('consult_list', $consult_list); Tpl::output('show_page', $model_consult->showpage()); // 咨询类型 $consult_type = uk86_rkcache('consult_type', true); Tpl::output('consult_type', $consult_type); $seo_param = array(); $seo_param['name'] = $goods_info['goods_name']; $seo_param['key'] = $goods_info['goods_keywords']; $seo_param['description'] = $goods_info['goods_description']; Model('seo')->type('product')->param($seo_param)->show(); Tpl::output('consult_able', $this->checkConsultAble($goods_info['store_id'])); Tpl::showpage('goods.consulting_list'); }
/** * 订单详细 * */ public function show_orderOp() { $order_id = intval($_GET['order_id']); if ($order_id <= 0) { uk86_showMessage(Uk86Language::uk86_get('member_order_none_exist'), '', 'html', 'error'); } $model_order = Model('order'); $condition = array(); $condition['order_id'] = $order_id; $condition['buyer_id'] = $_SESSION['member_id']; $order_info = $model_order->getOrderInfo($condition, array('order_goods', 'order_common', 'store')); if (empty($order_info) || $order_info['delete_state'] == ORDER_DEL_STATE_DROP) { uk86_showMessage(Uk86Language::uk86_get('member_order_none_exist'), '', 'html', 'error'); } $model_refund_return = Model('refund_return'); $order_list = array(); $order_list[$order_id] = $order_info; $order_list = $model_refund_return->getGoodsRefundList($order_list, 1); //订单商品的退款退货显示 $order_info = $order_list[$order_id]; $refund_all = $order_info['refund_list'][0]; if (!empty($refund_all) && $refund_all['seller_state'] < 3) { //订单全部退款商家审核状态:1为待审核,2为同意,3为不同意 Tpl::output('refund_all', $refund_all); } //显示锁定中 $order_info['if_lock'] = $model_order->getOrderOperateState('lock', $order_info); //显示取消订单 $order_info['if_cancel'] = $model_order->getOrderOperateState('buyer_cancel', $order_info); //显示退款取消订单 $order_info['if_refund_cancel'] = $model_order->getOrderOperateState('refund_cancel', $order_info); //显示投诉 $order_info['if_complain'] = $model_order->getOrderOperateState('complain', $order_info); //显示收货 $order_info['if_receive'] = $model_order->getOrderOperateState('receive', $order_info); //显示物流跟踪 $order_info['if_deliver'] = $model_order->getOrderOperateState('deliver', $order_info); //显示评价 $order_info['if_evaluation'] = $model_order->getOrderOperateState('evaluation', $order_info); //显示分享 $order_info['if_share'] = $model_order->getOrderOperateState('share', $order_info); //显示系统自动取消订单日期 if ($order_info['order_state'] == ORDER_STATE_NEW) { //$order_info['order_cancel_day'] = $order_info['add_time'] + ORDER_AUTO_CANCEL_DAY * 24 * 3600; // by ukshop.com $order_info['order_cancel_day'] = $order_info['add_time'] + ORDER_AUTO_CANCEL_DAY + 3 * 24 * 3600; } //显示快递信息 if ($order_info['shipping_code'] != '') { $express = uk86_rkcache('express', true); $order_info['express_info']['e_code'] = $express[$order_info['extend_order_common']['shipping_express_id']]['e_code']; $order_info['express_info']['e_name'] = $express[$order_info['extend_order_common']['shipping_express_id']]['e_name']; $order_info['express_info']['e_url'] = $express[$order_info['extend_order_common']['shipping_express_id']]['e_url']; } //显示系统自动收获时间 if ($order_info['order_state'] == ORDER_STATE_SEND) { //$order_info['order_confirm_day'] = $order_info['delay_time'] + ORDER_AUTO_RECEIVE_DAY * 24 * 3600; //by ukshop.com $order_info['order_confirm_day'] = $order_info['delay_time'] + ORDER_AUTO_RECEIVE_DAY + 15 * 24 * 3600; } //如果订单已取消,取得取消原因、时间,操作人 if ($order_info['order_state'] == ORDER_STATE_CANCEL) { $order_info['close_info'] = $model_order->getOrderLogInfo(array('order_id' => $order_info['order_id']), 'log_id desc'); } foreach ($order_info['extend_order_goods'] as $value) { $value['image_60_url'] = uk86_cthumb($value['goods_image'], 60, $value['store_id']); $value['image_240_url'] = uk86_cthumb($value['goods_image'], 240, $value['store_id']); $value['goods_type_cn'] = uk86_orderGoodsType($value['goods_type']); $value['goods_url'] = uk86_urlShop('goods', 'index', array('goods_id' => $value['goods_id'])); if ($value['goods_type'] == 5) { $order_info['zengpin_list'][] = $value; } else { $order_info['goods_list'][] = $value; } } if (empty($order_info['zengpin_list'])) { $order_info['goods_count'] = count($order_info['goods_list']); } else { $order_info['goods_count'] = count($order_info['goods_list']) + 1; } Tpl::output('order_info', $order_info); //卖家发货信息 if (!empty($order_info['extend_order_common']['daddress_id'])) { $daddress_info = Model('daddress')->getAddressInfo(array('address_id' => $order_info['extend_order_common']['daddress_id'])); Tpl::output('daddress_info', $daddress_info); } Tpl::showpage('member_order.show'); }
public function getApById($apId) { $apId = (int) $apId; return uk86_rkcache("adv/{$apId}", array($this, 'getApByCacheId')); }
/** * 从TAG中查找分类 */ public function getTagCategory($keyword = '') { if ($keyword != '') { // 跟据class_tag缓存搜索出与keyword相关的分类 $tag_list = uk86_rkcache('class_tag', true); if (!empty($tag_list) && is_array($tag_list)) { foreach ($tag_list as $key => $val) { $tag_value = str_replace(',', '==ShopNC==', $val['gc_tag_value']); if (strpos($tag_value, $keyword)) { $data[] = $val['gc_id']; } } } } return $data; }
/** * 调用推荐位 * * @param unknown_type $rec_id * @return string */ function uk86_rec_position($rec_id = null) { if (!is_numeric($rec_id)) { return null; } $string = ''; if (C('cache_open')) { $info = uk86_rkcache("rec_position/{$rec_id}", function ($rec_id) { $rec_id = substr($rec_id, strlen('rec_position/')); return Model('rec_position')->find($rec_id); }); } else { $file = BASE_DATA_PATH . '/cache/rec_position/' . $rec_id . '.php'; if (file_exists($file)) { $info = (require $file); } else { $info = Model('rec_position')->find($rec_id); uk86_write_file($file, $info); } } $info['content'] = unserialize($info['content']); if ($info['content']['target'] == 2) { $target = 'target="_blank"'; } else { $target = ''; } if ($info['pic_type'] == 0) { //文字 foreach ((array) $info['content']['body'] as $v) { $href = ''; if ($v['url'] != '') { $href = "href=\"{$v['url']}\""; } $string .= "<li><a {$target} {$href}>{$v['title']}</a></li>"; } $string = "<ul>{$string}</ul>"; } else { //图片 $width = $height = ''; if (is_numeric($info['content']['width'])) { $width = "width=\"{$info['content']['width']}\""; } if (is_numeric($info['content']['height'])) { $height = "height=\"{$info['content']['height']}\""; } if (is_array($info['content']['body'])) { if (count($info['content']['body']) > 1) { foreach ($info['content']['body'] as $v) { if ($info['pic_type'] == 1) { $v['title'] = UPLOAD_SITE_URL . '/' . $v['title']; } $href = ''; if ($v['url'] != '') { $href = "href=\"{$v['url']}\""; } $string .= "<li><a {$target} {$href}><img {$width} {$height} src=\"{$v['title']}\"></a></li>"; } $string = "<ul>{$string}</ul>"; } else { $v = $info['content']['body'][0]; if ($info['pic_type'] == 1) { $v['title'] = UPLOAD_SITE_URL . '/' . $v['title']; } $href = ''; if ($v['url'] != '') { $href = "href=\"{$v['url']}\""; } $string .= "<a {$target} {$href}><img {$width} {$height} src=\"{$v['title']}\"></a>"; } } } return $string; }
/** * 卡券包列表 */ public function pointvoucherOp() { //查询会员及其附属信息 parent::pointshopMInfo(); $model_voucher = Model('voucher'); //卡券包模板状态 $templatestate_arr = $model_voucher->getTemplateState(); //查询会员信息 $member_info = Model('member')->getMemberInfoByID($_SESSION['member_id']); //查询卡券包列表 $where = array(); $where['voucher_t_state'] = $templatestate_arr['usable'][0]; $where['voucher_t_end_date'] = array('gt', time()); if (intval($_GET['sc_id']) > 0) { $where['voucher_t_sc_id'] = intval($_GET['sc_id']); } if (intval($_GET['price']) > 0) { $where['voucher_t_price'] = intval($_GET['price']); } //查询仅我能兑换和所需U币 $points_filter = array(); if (intval($_GET['isable']) == 1) { $points_filter['isable'] = $member_info['member_points']; } if (intval($_GET['points_min']) > 0) { $points_filter['min'] = intval($_GET['points_min']); } if (intval($_GET['points_max']) > 0) { $points_filter['max'] = intval($_GET['points_max']); } if (count($points_filter) > 0) { asort($points_filter); if (count($points_filter) > 1) { $points_filter = array_values($points_filter); $where['voucher_t_points'] = array('between', array($points_filter[0], $points_filter[1])); } else { if ($points_filter['min']) { $where['voucher_t_points'] = array('egt', $points_filter['min']); } elseif ($points_filter['max']) { $where['voucher_t_points'] = array('elt', $points_filter['max']); } elseif ($points_filter['isable']) { $where['voucher_t_points'] = array('elt', $points_filter['isable']); } } } //排序 switch ($_GET['orderby']) { case 'exchangenumdesc': $orderby = 'voucher_t_giveout desc,'; break; case 'exchangenumasc': $orderby = 'voucher_t_giveout asc,'; break; case 'pointsdesc': $orderby = 'voucher_t_points desc,'; break; case 'pointsasc': $orderby = 'voucher_t_points asc,'; break; } $orderby .= 'voucher_t_id desc'; $voucherlist = $model_voucher->getVoucherTemplateList($where, '*', 0, 18, $orderby); Tpl::output('voucherlist', $voucherlist); Tpl::output('show_page', $model_voucher->showpage(2)); //查询卡券包面额 $pricelist = $model_voucher->getVoucherPriceList(); Tpl::output('pricelist', $pricelist); //查询店铺分类 $store_class = uk86_rkcache('store_class', true); Tpl::output('store_class', $store_class); //分类导航 $nav_link = array(0 => array('title' => Uk86Language::uk86_get('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => 'U币', 'link' => uk86_urlShop('pointshop', 'index')), 2 => array('title' => '卡券包列表')); Tpl::output('nav_link_list', $nav_link); Tpl::showpage('pointvoucher'); }
public function templateeditOp() { $t_id = intval($_GET['tid']); if ($t_id <= 0) { $t_id = intval($_POST['tid']); } if ($t_id <= 0) { uk86_showMessage(Uk86Language::uk86_get('wrong_argument'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error'); } $model = Model('voucher'); //查询模板信息 $param = array(); $param['voucher_t_id'] = $t_id; $param['voucher_t_store_id'] = $_SESSION['store_id']; $param['voucher_t_state'] = $this->templatestate_arr['usable'][0]; $param['voucher_t_giveout'] = array('elt', '0'); $param['voucher_t_end_date'] = array('gt', time()); $t_info = $model->table('voucher_template')->where($param)->find(); if (empty($t_info)) { uk86_showMessage(Uk86Language::uk86_get('wrong_argument'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error'); } if ($isOwnShop = uk86_checkPlatformStore()) { Tpl::output('isOwnShop', true); } else { //查询套餐信息 $quotainfo = $model->table('voucher_quota')->where(array('quota_id' => $t_info['voucher_t_quotaid'], 'quota_storeid' => $_SESSION['store_id']))->find(); if (empty($quotainfo)) { uk86_showMessage(Uk86Language::uk86_get('voucher_template_quotanull'), 'index.php?act=store_voucher&op=quotaadd', 'html', 'error'); } } //查询面额列表 $pricelist = $model->table('voucher_price')->order('voucher_price asc')->select(); if (empty($pricelist)) { uk86_showMessage(Uk86Language::uk86_get('voucher_template_pricelisterror'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error'); } if (uk86_chksubmit()) { //验证提交的内容面额不能大于限额 $obj_validate = new Uk86Validate(); $obj_validate->validateparam = array(array("input" => $_POST['txt_template_title'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "50", "message" => Uk86Language::uk86_get('voucher_template_title_error')), array("input" => $_POST['txt_template_total'], "require" => "true", "validator" => "Number", "message" => Uk86Language::uk86_get('voucher_template_total_error')), array("input" => $_POST['select_template_price'], "require" => "true", "validator" => "Number", "message" => Uk86Language::uk86_get('voucher_template_price_error')), array("input" => $_POST['txt_template_limit'], "require" => "true", "validator" => "Double", "message" => Uk86Language::uk86_get('voucher_template_limit_error')), array("input" => $_POST['txt_template_describe'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Uk86Language::uk86_get('voucher_template_describe_error'))); $error = $obj_validate->uk86_validate(); //金额验证 $price = intval($_POST['select_template_price']) > 0 ? intval($_POST['select_template_price']) : 0; foreach ($pricelist as $k => $v) { if ($v['voucher_price'] == $price) { $chooseprice = $v; //取得当前选择的面额记录 } } if (empty($chooseprice)) { $error .= Uk86Language::uk86_get('voucher_template_pricelisterror'); } $limit = intval($_POST['txt_template_limit']) > 0 ? intval($_POST['txt_template_limit']) : 0; if ($price >= $limit) { $error .= Uk86Language::uk86_get('voucher_template_price_error'); } if ($error) { showDialog($error, 'reload', 'error'); } else { $update_arr = array(); $update_arr['voucher_t_title'] = trim($_POST['txt_template_title']); $update_arr['voucher_t_desc'] = trim($_POST['txt_template_describe']); if ($_POST['txt_template_enddate']) { $enddate = strtotime($_POST['txt_template_enddate']); if (!$isOwnShop && $enddate > $quotainfo['quota_endtime']) { $enddate = $quotainfo['quota_endtime']; } $update_arr['voucher_t_end_date'] = $enddate; } else { //如果没有添加有效期则默认为套餐的结束时间 if ($isOwnShop) { $update_arr['voucher_t_end_date'] = time() + 2592000; } else { $update_arr['voucher_t_end_date'] = $quotainfo['quota_endtime']; } } $update_arr['voucher_t_price'] = $price; $update_arr['voucher_t_limit'] = $limit; $update_arr['voucher_t_sc_id'] = intval($_POST['sc_id']); $update_arr['voucher_t_state'] = intval($_POST['tstate']) == $this->templatestate_arr['usable'][0] ? $this->templatestate_arr['usable'][0] : $this->templatestate_arr['disabled'][0]; $update_arr['voucher_t_total'] = intval($_POST['txt_template_total']) > 0 ? intval($_POST['txt_template_total']) : 0; $update_arr['voucher_t_points'] = $chooseprice['voucher_defaultpoints']; $update_arr['voucher_t_eachlimit'] = intval($_POST['eachlimit']) > 0 ? intval($_POST['eachlimit']) : 0; //自定义图片 if (!empty($_FILES['customimg']['name'])) { $upload = new Uk86UploadFile(); $upload->uk86_set('default_dir', ATTACH_VOUCHER . DS . $_SESSION['store_id']); $upload->uk86_set('thumb_width', '160'); $upload->uk86_set('thumb_height', '160'); $upload->uk86_set('thumb_ext', '_small'); $result = $upload->uk86_upfile('customimg'); if ($result) { //删除原图 if (!empty($t_info['voucher_t_customimg'])) { //如果模板存在,则删除原模板图片 @unlink(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $t_info['voucher_t_customimg']); @unlink(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . str_ireplace('.', '_small.', $t_info['voucher_t_customimg'])); } $update_arr['voucher_t_customimg'] = $upload->file_name; } } $rs = $model->table('voucher_template')->where(array('voucher_t_id' => $t_info['voucher_t_id']))->update($update_arr); if ($rs) { showDialog(Uk86Language::uk86_get('nc_common_op_succ'), 'index.php?act=store_voucher&op=templatelist', 'succ'); } else { showDialog(Uk86Language::uk86_get('nc_common_op_fail'), 'index.php?act=store_voucher&op=templatelist', 'error'); } } } else { if (!$t_info['voucher_t_customimg'] || !file_exists(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $t_info['voucher_t_customimg'])) { $t_info['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . uk86_defaultGoodsImage(240); } else { $t_info['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . str_ireplace('.', '_small.', $t_info['voucher_t_customimg']); } TPL::output('type', 'edit'); TPL::output('t_info', $t_info); //店铺分类 $store_class = uk86_rkcache('store_class', true); Tpl::output('store_class', $store_class); //查询店铺详情 $store_info = Model('store')->getStoreInfoByID($_SESSION['store_id']); TPL::output('store_info', $store_info); TPL::output('quotainfo', $quotainfo); TPL::output('pricelist', $pricelist); $this->profile_menu('templateedit', 'templateedit'); Tpl::showpage('store_voucher_template.add'); } }
public function step3Op() { $model_store_joinin = Model('store_joinin'); $joinin_detail = $model_store_joinin->getOne(array('member_id' => $_SESSION['member_id'])); if (!empty($joinin_detail)) { Tpl::output('joininfo', $joinin_detail); } if (!empty($_POST)) { $param = array(); $param['settlement_bank_account_name'] = $_POST['settlement_bank_account_name']; $param['settlement_bank_account_number'] = $_POST['settlement_bank_account_number']; $this->step3_save_valid($param); $model_store_joinin = Model('store_joinin'); $model_store_joinin->modify($param, array('member_id' => $_SESSION['member_id'])); } //商品分类 $gc = Model('goods_class'); $gc_list = $gc->getGoodsClassListByParentId(0); Tpl::output('gc_list', $gc_list); //店铺等级 $grade_list = uk86_rkcache('store_grade', true); //附加功能 if (!empty($grade_list) && is_array($grade_list)) { foreach ($grade_list as $key => $grade) { $sg_function = explode('|', $grade['sg_function']); if (!empty($sg_function[0]) && is_array($sg_function)) { foreach ($sg_function as $key1 => $value) { if ($value == 'editor_multimedia') { $grade_list[$key]['function_str'] .= '富文本编辑器'; } } } else { $grade_list[$key]['function_str'] = '无'; } } } Tpl::output('grade_list', $grade_list); //店铺分类 $model_store = Model('store_class'); $store_class = $model_store->getStoreClassList(array(), '', false); Tpl::output('store_class', $store_class); Tpl::output('step', '3'); Tpl::output('sub_step', 'step3'); Tpl::showpage('store_joinin_c2c_apply'); exit; }
/** * 取得分类关键词,方便SEO */ public function getKeyWords($gc_id = null) { if (empty($gc_id)) { return false; } $keywrods = uk86_rkcache('goods_class_seo', true); $seo_title = $keywrods[$gc_id]['title']; $seo_key = ''; $seo_desc = ''; if ($gc_id > 0) { if (isset($keywrods[$gc_id])) { $seo_key .= $keywrods[$gc_id]['key'] . ','; $seo_desc .= $keywrods[$gc_id]['desc'] . ','; } $goods_class = Model('goods_class')->getGoodsClassIndexedListAll(); if (($gc_id = $goods_class[$gc_id]['gc_parent_id']) > 0) { if (isset($keywrods[$gc_id])) { $seo_key .= $keywrods[$gc_id]['key'] . ','; $seo_desc .= $keywrods[$gc_id]['desc'] . ','; } } if (($gc_id = $goods_class[$gc_id]['gc_parent_id']) > 0) { if (isset($keywrods[$gc_id])) { $seo_key .= $keywrods[$gc_id]['key'] . ','; $seo_desc .= $keywrods[$gc_id]['desc'] . ','; } } } return array(1 => $seo_title, 2 => trim($seo_key, ','), 3 => trim($seo_desc, ',')); }
/** * 所有品牌 */ public function brand_allOp() { //读取语言包 Uk86Language::uk86_read('home_store_class_index'); $lang = Uk86Language::uk86_getLangContent(); //店铺类目快速搜索 $class_list = ($h = F('store_class')) ? $h : uk86_rkcache('store_class', true, 'file'); if (!key_exists($_GET['cate_id'], $class_list)) { $_GET['cate_id'] = 0; } Tpl::output('class_list', $class_list); //店铺搜索 $model = Model(); $condition = array(); $keyword = trim($_GET['keyword']); if (C('fullindexer.open') && !empty($keyword)) { //全文搜索 $condition = $this->full_search($keyword); } else { if ($keyword != '') { $condition['store_name|store_zy'] = array('like', '%' . $keyword . '%'); } if ($_GET['user_name'] != '') { $condition['member_name'] = trim($_GET['user_name']); } } if (!empty($_GET['area_info'])) { $condition['area_info'] = array('like', '%' . $_GET['area_info'] . '%'); } if ($_GET['cate_id'] > 0) { $child = array_merge((array) $class_list[$_GET['cate_id']]['child'], array($_GET['cate_id'])); $condition['sc_id'] = array('in', $child); } $condition['store_state'] = 1; if (!in_array($_GET['order'], array('desc', 'asc'))) { unset($_GET['order']); } if (!in_array($_GET['key'], array('store_sales', 'store_credit'))) { unset($_GET['key']); } $order = 'store_sort asc'; if (isset($condition['store.store_id'])) { $condition['store_id'] = $condition['store.store_id']; unset($condition['store.store_id']); } $model_store = Model('store'); $store_list = $model_store->where($condition)->order($order)->page(10)->select(); //获取店铺商品数,推荐商品列表等信息 $store_list = $model_store->getStoreSearchList($store_list); //print_r($store_list);exit(); //信用度排序 if ($_GET['key'] == 'store_credit') { if ($_GET['order'] == 'desc') { $store_list = sortClass::sortArrayDesc($store_list, 'store_credit_average'); } else { $store_list = sortClass::sortArrayAsc($store_list, 'store_credit_average'); } } else { if ($_GET['key'] == 'store_sales') { //销量排行 if ($_GET['order'] == 'desc') { $store_list = sortClass::sortArrayDesc($store_list, 'num_sales_jq'); } else { $store_list = sortClass::sortArrayAsc($store_list, 'num_sales_jq'); } } } Tpl::output('store_list', $store_list); Tpl::output('show_page', $model->showpage(2)); //当前位置 if (intval($_GET['cate_id']) > 0) { $nav_link[1]['link'] = 'index.php?act=shop_search'; $nav_link[1]['title'] = $lang['site_search_store']; $nav = $class_list[$_GET['cate_id']]; //如果有父级 if ($nav['sc_parent_id'] > 0) { $tmp = $class_list[$nav['sc_parent_id']]; //存入父级 $nav_link[] = array('title' => $tmp['sc_name'], 'link' => "index.php?act=store_list&cate_id=" . $nav['sc_parent_id']); } //存入当前级 $nav_link[] = array('title' => $nav['sc_name']); } else { $nav_link[1]['link'] = 'index.php'; $nav_link[1]['title'] = $lang['homepage']; $nav_link[2]['title'] = $lang['site_search_store']; } $purl = $this->getParam(); Tpl::output('nav_link_list', $nav_link); Tpl::output('purl', uk86_urlShop($purl['act'], $purl['op'], $purl['param'])); //SEO Model('seo')->type('index')->show(); Tpl::output('html_title', (empty($_GET['keyword']) ? '' : $_GET['keyword'] . ' - ') . C('site_name') . $lang['nc_common_search']); Tpl::showpage('brand_all'); }
/** * 物流跟踪 */ public function search_deliverOp() { Uk86Language::uk86_read('member_member_index'); $lang = Uk86Language::uk86_getLangContent(); $order_sn = $_GET['order_sn']; if (!is_numeric($order_sn)) { uk86_showMessage(Uk86Language::uk86_get('wrong_argument'), '', 'html', 'error'); } $model_order = Model('order'); $condition['order_sn'] = $order_sn; $condition['store_id'] = $_SESSION['store_id']; $order_info = $model_order->getOrderInfo($condition, array('order_common', 'order_goods')); if (empty($order_info) || $order_info['shipping_code'] == '') { uk86_showMessage('未找到信息', '', 'html', 'error'); } $order_info['state_info'] = uk86_orderState($order_info); Tpl::output('order_info', $order_info); //卖家发货信息 $daddress_info = Model('daddress')->getAddressInfo(array('address_id' => $order_info['extend_order_common']['daddress_id'])); Tpl::output('daddress_info', $daddress_info); //取得配送公司代码 $express = uk86_rkcache('express', true); Tpl::output('e_code', $express[$order_info['extend_order_common']['shipping_express_id']]['e_code']); Tpl::output('e_name', $express[$order_info['extend_order_common']['shipping_express_id']]['e_name']); Tpl::output('e_url', $express[$order_info['extend_order_common']['shipping_express_id']]['e_url']); Tpl::output('shipping_code', $order_info['shipping_code']); self::profile_menu('search', 'search'); Tpl::showpage('store_deliver.detail'); }
/** * 创建圈子 */ public function add_groupOp() { if ($_SESSION['is_login'] != 1) { @header('location: ' . SHOP_SITE_URL . '/index.php?act=login&ref_url=' . getRefUrl()); } if (!intval(C('circle_iscreate'))) { uk86_showMessage(L('circle_grooup_not_create'), '', '', 'error'); } $model = Model(); // 在验证 // 允许创建圈子验证 $where = array(); $where['circle_masterid'] = $_SESSION['member_id']; $create_count = $model->table('circle')->where($where)->count(); if (intval($create_count) >= C('circle_createsum')) { showDialog(L('circle_create_max_error')); } // 允许加入圈子验证 $where = array(); $where['member_id'] = $_SESSION['member_id']; $join_count = $model->table('circle_member')->where($where)->count(); if (intval($join_count) >= C('circle_joinsum')) { showDialog(L('circle_join_max_error')); } if (uk86_chksubmit()) { /** * 验证 */ $obj_validate = new Uk86Validate(); $obj_validate->validateparam = array(array("input" => $_POST["c_name"], "require" => "true", "message" => L('circle_name_not_null'))); $error = $obj_validate->uk86_validate(); if ($error != '') { showDialog($error); } else { $insert = array(); $insert['circle_name'] = $_POST['c_name']; $insert['circle_masterid'] = $_SESSION['member_id']; $insert['circle_mastername'] = $_SESSION['member_name']; $insert['circle_desc'] = $_POST['c_desc']; $insert['circle_tag'] = $_POST['c_tag']; $insert['circle_pursuereason'] = $_POST['c_pursuereason']; $insert['circle_status'] = 2; $insert['is_recommend'] = 0; $insert['class_id'] = intval($_POST['class_id']); $insert['circle_addtime'] = time(); $insert['circle_mcount'] = 1; $result = $model->table('circle')->insert($insert); if ($result) { // Membership level information $data = uk86_rkcache('circle_level') ? uk86_rkcache('circle_level') : uk86_rkcache('circle_level', true); // 把圈主信息加入圈子会员表 $insert = array(); $insert['member_id'] = $_SESSION['member_id']; $insert['circle_id'] = $result; $insert['circle_name'] = $_POST['c_name']; $insert['member_name'] = $_SESSION['member_name']; $insert['cm_applytime'] = $insert['cm_jointime'] = time(); $insert['cm_state'] = 1; $insert['cm_level'] = $data[1]['mld_id']; $insert['cm_levelname'] = $data[1]['mld_name']; $insert['cm_exp'] = 1; $insert['cm_nextexp'] = $data[2]['mld_exp']; $insert['is_identity'] = 1; $insert['cm_lastspeaktime'] = ''; $model->table('circle_member')->insert($insert); showDialog(L('nc_common_op_succ'), 'index.php?act=group&c_id=' . $result, 'succ'); } else { showDialog(L('nc_common_op_fail')); } } } Tpl::output('create_count', $create_count); Tpl::output('join_count', $join_count); // 圈子分类 $class_list = $model->table('circle_class')->where(array('class_status' => 1))->order('class_sort asc')->select(); Tpl::output('class_list', $class_list); $this->circleSEO(L('circle_create')); Tpl::showpage('group_add'); }
public function expressOp() { $model = Model('store_extend'); if (uk86_chksubmit()) { $data['store_id'] = $_SESSION['store_id']; if (is_array($_POST['cexpress']) && !empty($_POST['cexpress'])) { $data['express'] = implode(',', $_POST['cexpress']); } else { $data['express'] = ''; } if (!$model->getby_store_id($_SESSION['store_id'])) { $result = $model->insert($data); } else { $result = $model->update($data); } if ($result) { showDialog(Uk86Language::uk86_get('nc_common_save_succ'), 'reload', 'succ'); } else { showDialog(Uk86Language::uk86_get('nc_common_save_fail'), 'reload', 'error'); } } $express_list = uk86_rkcache('express', true); //取得店铺启用的快递公司ID $express_select = $model->getfby_store_id($_SESSION['store_id'], 'express'); if (!is_null($express_select)) { $express_select = explode(',', $express_select); } else { $express_select = array(); } Tpl::output('express_select', $express_select); //页面输出 self::profile_menu('daddress', 'express'); Tpl::output('express_list', $express_list); Tpl::showpage('store_deliver_express'); }