public function getMore() { $url_type = isWeixin(); //判断微信打开 $is_android = is_android(); $is_ios = is_ios(); if ($is_android) { if ($url_type) { $this->where["myapp_url"] = array("neq", ""); } $type = "android"; } if ($is_ios) { if ($url_type) { $this->where["myios_url"] = array("neq", ""); } $type = "ios"; } $result = $this->getList($this->where); $this->assign('url_type', $url_type); $this->assign('data', $result); $this->assign('type', $type); $this->display('page'); }
.widgets, .footer-post-meta, #under-entry-body, #footer, #footer-mobile-buttons{ display: none; } div#container { margin-top: 0; margin-bottom: 0; } <?php } //is_page_type_content_only //iOSの時は:hoverのスタイルを変更する if (is_ios()) { ?> a.balloon-btn-link:hover, .snsbs li a:hover, ul.snsp li a:hover, #mobile-menu a:hover, #page-top a:hover { opacity: 1; } <?php } //シェア数を表示しない場合 if (!is_all_share_count_visible() && is_simplicity_share_button()) { ?> /*数字部分を消す*/ .social-count {
function custom_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome; // Top level if (is_handheld()) { $classes[] = "handheld"; } if (is_mobile()) { $classes[] = "mobile"; } if (is_ios()) { $classes[] = "ios"; } if (is_tablet()) { $classes[] = "tablet"; } // Specific if (is_iphone()) { $classes[] = "iphone"; } if (is_ipad()) { $classes[] = "ipad"; } if (is_ipod()) { $classes[] = "ipod"; } if (is_android()) { $classes[] = "android"; } if (is_blackberry()) { $classes[] = "blackberry"; } if (is_opera_mobile()) { $classes[] = "opera-mobile"; } if (is_palm()) { $classes[] = "palm"; } if (is_symbian()) { $classes[] = "symbian"; } if (is_windows_mobile()) { $classes[] = "windows-mobile"; } if (is_lg()) { $classes[] = "lg"; } if (is_motorola()) { $classes[] = "motorola"; } if (is_nokia()) { $classes[] = "nokia"; } if (is_samsung()) { $classes[] = "samsung"; } if (is_samsung_galaxy_tab()) { $classes[] = "samsung-galaxy-tab"; } if (is_sony_ericsson()) { $classes[] = "sony-ericsson"; } if (is_nintendo()) { $classes[] = "nintendo"; } // Computer browser if (!is_handheld()) { $classes[] = "desktop"; } if ($is_lynx) { $classes[] = "lynx"; } if ($is_gecko) { $classes[] = "gecko"; } if ($is_opera) { $classes[] = "opera"; } if ($is_NS4) { $classes[] = "ns4"; } if ($is_safari) { $classes[] = "safari"; } if ($is_chrome) { $classes[] = "chrome"; } if ($is_IE) { $classes[] = "ie"; } // IE Version check $ie_check = array(); $ie_classes = array('ie7', 'ie8', 'ie9', 'ie10'); $version = 7; while ($version < 11) { $ie_check[] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ' . $version . '.') !== FALSE; ++$version; } $ie = ''; foreach ($ie_check as $key => $value) { if ($value == 1) { $ie = $ie_classes[$key] . ' oldie'; } } $classes[] = $ie; // Check user logged in? if (!is_user_logged_in()) { $classes[] = 'not-login'; } return $classes; }
function mobble_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $mobble_detect; // top level if (is_handheld()) { $classes[] = "handheld"; } if (is_mobile()) { $classes[] = "mobile"; } if (is_ios()) { $classes[] = "ios"; } if (is_tablet()) { $classes[] = "tablet"; } // specific if (is_iphone()) { $classes[] = "iphone"; } if (is_ipad()) { $classes[] = "ipad"; } if (is_ipod()) { $classes[] = "ipod"; } if (is_android()) { $classes[] = "android"; } if (is_blackberry()) { $classes[] = "blackberry"; } if (is_opera_mobile()) { $classes[] = "opera-mobile"; } if (is_webos()) { $classes[] = "webos"; } if (is_symbian()) { $classes[] = "symbian"; } if (is_windows_mobile()) { $classes[] = "windows-mobile"; } //if (is_lg()) { $classes[] = "lg"; } if (is_motorola()) { $classes[] = "motorola"; } //if (is_smartphone()) { $classes[] = "smartphone"; } //if (is_nokia()) { $classes[] = "nokia"; } if (is_samsung()) { $classes[] = "samsung"; } if (is_samsung_tablet()) { $classes[] = "samsung-tablet"; } if (is_sony_ericsson()) { $classes[] = "sony-ericsson"; } if (is_nintendo()) { $classes[] = "nintendo"; } // bonus if (!is_handheld()) { $classes[] = "desktop"; } if ($is_lynx) { $classes[] = "lynx"; } if ($is_gecko) { $classes[] = "gecko"; } if ($mobble_detect->is('Gecko')) { $classes[] = "gecko"; } if ($is_opera) { $classes[] = "opera"; } if ($mobble_detect->is('Opera')) { $classes[] = "opera"; } if ($is_NS4) { $classes[] = "ns4"; } if ($is_safari) { $classes[] = "safari"; } if ($mobble_detect->is('Safari')) { $classes[] = "safari"; } if ($is_chrome) { $classes[] = "chrome"; } if ($mobble_detect->is('Chrome')) { $classes[] = "chrome"; } if ($is_IE) { $classes[] = "ie"; } if ($mobble_detect->is('IE')) { $classes[] = "ie"; } return $classes; }
/** * 添加订单 * * @author yugang@dachuwang.com * @since 2015-03-06 */ public function create() { if (isset($_POST['subUserId']) && $this->_user_info['id'] != $_POST['subUserId']) { $this->load->model('MCustomer'); $cur = $this->MCustomer->get_user_info(array('id' => $_POST['subUserId'])); } else { $cur = $this->_user_info; } // 获取当前登录客户 //$cur = $this->_user_info_with_ip(); $_POST['user_id'] = $cur['id']; $_POST['site_id'] = C('site.dachu'); if (empty($_POST['products'])) { $res['status'] = -1; $res['msg'] = '您的购物车没有商品,请重新操作。'; $this->_return_json($res); } $this->_filter_app_post(); //检查是否有不同客户类型的商品 $ptype = $this->_check_customer_type($_POST['products'], $cur); // 检测其中是否有异市销售的商品---add by xianwen 15-4-8 $ids = array_unique(array_column($_POST['products'], 'location_id')); if (array_diff(array($cur['province_id']), $ids)) { $this->_return_json(array('status' => C('tips.code.op_failed'), 'msg' => '购买商品中有其他城市销售的商品, 请去购物车检查下再下单')); } else { $_POST['location_id'] = $ids[0]; } // 检查配送时间是否可以当天下午 $can_today_deliver = $this->_check_daily_deliver($_POST['products'], $cur['province_id']); // 检查配送时间是否合法 $deliver_time = isset($_POST['deliver_time']) ? $_POST['deliver_time'] : ''; $deliver_date = isset($_POST['deliver_date']) ? $_POST['deliver_date'] : ''; if (!$this->_check_deliver_time_valid($deliver_date, $deliver_time, $can_today_deliver)) { $arr = array('status' => -1, 'msg' => '根据您下单的时间和产品,该配送时间不可选,请选择稍晚的配送时间。'); $this->_return_json($arr); } // 检测限购 $this->_check_buy_limit($cur); $this->_set_post_products(); // 检测商品中是否有在redis里面, // 并且购买的数量是否符合要求 $check_info = $this->format_query('/stock_service/check_storage', array('products' => $_POST['products'], 'line_id' => $cur['line_id'])); $_POST['products'] = isset($check_info['list']) ? $check_info['list'] : []; $this->check_storage->check($_POST['products'], $cur); // 检查活动规则是否匹配 $rules = $_POST['rules']; $return = $this->_check_rules($rules, $cur, $_POST['products'], $deliver_date); if ($return['diff']) { $arr = array('status' => -1, 'msg' => '您的订单不能参与部分活动,请重新提交。'); $this->_return_json($arr); } $total_price = $this->_cal_total_price($_POST['products']); // 首先得确认是满足优惠条件猜出 $minus_info = array(); $_POST['minus_info'] = $minus_info; // 存储最终的可参与的活动列表 $_POST['rules'] = $return['rules']; // 传过来的优惠券id,需要检测 if (!empty($_POST['coupon_id'])) { $customer_coupon_info = $this->format_query('/customer_coupon/check_coupon_valid', array('total_price' => $total_price * 100, 'id' => $_POST['coupon_id'], 'customer_id' => $this->_user_info['id'])); if (isset($customer_coupon_info['info'])) { $_POST['coupon_info'] = $customer_coupon_info['info']; } } if (!empty($cur['customer_type'])) { $_POST['customer_type'] = $cur['customer_type']; } $_POST['cur'] = $cur; if (!is_ios()) { $_POST['order_resource'] = C('order.resource.android.code'); } else { $_POST['order_resource'] = C('order.resource.ios.code'); } $_POST['user_id'] = $cur['id']; // 调用基础服务接口 $return = $this->format_query('/order/add', $_POST); // @todo if (!empty($_POST['coupon_id'])) { $this->format_query('/customer_coupon/set_coupon_used_nums', array('id' => $_POST['coupon_id'])); } // 修改订单中的商品的库存 if (intval($return['status']) === 0) { $this->_set_storage(array('products' => $_POST['products'], 'line_id' => $cur['line_id']), FALSE); } $this->_return_json($return); }