コード例 #1
0
ファイル: searchModule.class.php プロジェクト: macall/jsd
 /**
  * 智能跳转
  * 用于热门关键词的智能检索,优先搜团购->商品->优惠券->活动->商家->分享,如都没有提示没有相关数据
  */
 public function jump()
 {
     $kw = strim($_REQUEST['kw']);
     if ($kw) {
         $param['kw'] = $kw;
         $condition_param['city_id'] = $GLOBALS['city']['id'];
         global_run();
         //先验证团购
         require_once APP_ROOT_PATH . "system/model/deal.php";
         $ext_condition = "  d.buy_type <> 1 and d.is_shop = 0 ";
         $ext_condition .= " and d.name like '%" . $kw . "%' ";
         if (get_deal_count(array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition)) {
             app_redirect(url("index", "tuan", $param));
         } else {
             //商品
             $ext_condition = "  d.buy_type <> 1 and d.is_shop = 1 ";
             $ext_condition .= " and d.name like '%" . $kw . "%' ";
             if (get_goods_count(array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition)) {
                 app_redirect(url("index", "cate", $param));
             } else {
                 //优惠券
                 require_once APP_ROOT_PATH . "system/model/youhui.php";
                 $ext_condition = " y.name like '%" . $kw . "%' ";
                 if (get_youhui_count(array(YOUHUI_NOTICE, YOUHUI_ONLINE), $condition_param, "", $ext_condition)) {
                     app_redirect(url("index", "youhuis", $param));
                 } else {
                     //活动
                     require_once APP_ROOT_PATH . "system/model/event.php";
                     $ext_condition = " e.name like '%" . $kw . "%' ";
                     if (get_event_count(array(EVENT_NOTICE, EVENT_ONLINE), $condition_param, "", $ext_condition)) {
                         app_redirect(url("index", "events", $param));
                     } else {
                         //商家
                         require_once APP_ROOT_PATH . "system/model/supplier.php";
                         $ext_condition = " sl.name like '%" . $kw . "%' ";
                         $rs = get_location_list(1, $condition_param, "", $ext_condition);
                         if ($rs['list']) {
                             app_redirect(url("index", "stores", $param));
                         } else {
                             app_redirect(url("index", "discover", $param));
                         }
                     }
                 }
             }
         }
     } else {
         app_redirect(url("index"));
     }
 }
コード例 #2
0
function theme_widget_overview(&$setting, &$system)
{
    $time = strtotime(date("Y-m-d", strtotime('-7 days')));
    //鞋子
    $data['xz'] = get_goods_count(28) + get_goods_count(45);
    $data['xz_new'] = get_goods_count(28, $time) + get_goods_count(45, $time);
    //抓绒
    $data['zr'] = get_goods_count(21) + get_goods_count(38);
    $data['zr_new'] = get_goods_count(21, $time) + get_goods_count(38, $time);
    //冲锋衣/裤
    $data['cf'] = get_goods_count(20) + get_goods_count(26) + get_goods_count(37) + get_goods_count(43);
    $data['cf_new'] = get_goods_count(20, $time) + get_goods_count(26, $time) + get_goods_count(37, $time) + get_goods_count(43, $time);
    //三合一
    $data['shy'] = get_goods_count(18) + get_goods_count(35);
    $data['shy_new'] = get_goods_count(18, $time) + get_goods_count(35, $time);
    //羽绒服
    $data['yrf'] = get_goods_count(19) + get_goods_count(36);
    $data['yrf_new'] = get_goods_count(19, $time) + get_goods_count(36, $time);
    return $data;
    //根据挂件配置信息,取出数据 返回给挂件模板
}
コード例 #3
0
 /**
  * 销量
  * @param unknown $goods_id
  * @return Ambigous <string, boolean>
  */
 function get_sales_count($goods_id)
 {
     return get_goods_count($goods_id);
 }
コード例 #4
0
ファイル: v_shop.php プロジェクト: moonlight-wang/feilun
if ($_CFG['is_distrib'] == 0) {
    show_message('没有开启微信分销服务!', '返回首页', 'index.php');
}
$user_id = intval($_REQUEST['user_id']);
if (!$smarty->is_cached('v_shop.dwt', $cache_id)) {
    assign_template();
    $position = assign_ur_here();
    $smarty->assign('page_title', $position['title']);
    // 页面标题
    $smarty->assign('ur_here', $position['ur_here']);
    // 当前位置
    /* meta information */
    $smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
    $smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
    $smarty->assign('user_info', get_user_info_by_user_id($user_id));
    $smarty->assign('goods_count', get_goods_count());
    $smarty->assign('cat_list', get_cat());
    $smarty->assign('goods_list', get_all_distrib_goods());
    $smarty->assign('user_id', $user_id);
    $smarty->assign('dp_info', get_dianpu_by_user_id($user_id));
    /* 页面中的动态内容 */
    assign_dynamic('v_shop');
}
$smarty->display('v_shop.dwt', $cache_id);
//获取分销商品数量
function get_goods_count()
{
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('ecsmart_distrib_goods') . " WHERE distrib_time = 0 OR (start_time <= '" . gmtime() . "' AND end_time >= '" . gmtime() . "')";
    return $GLOBALS['db']->getOne($sql);
}
//获取所有分销商品