当前位置: 首页>>代码示例>>PHP>>正文


PHP db_create_in函数代码示例

本文整理汇总了PHP中db_create_in函数的典型用法代码示例。如果您正苦于以下问题:PHP db_create_in函数的具体用法?PHP db_create_in怎么用?PHP db_create_in使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了db_create_in函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insert_history

/**
 * 调用浏览历史
 *
 * @access  public
 * @return  string
 */
function insert_history()
{
    $time = gmtime();
    $str = '';
    if (!empty($_COOKIE['ECS']['history'])) {
        $where = db_create_in($_COOKIE['ECS']['history'], 'goods_id');
        $sql = 'SELECT goods_id, goods_name, goods_thumb, shop_price ,promote_price,promote_start_date,promote_end_date,is_promote FROM ' . $GLOBALS['ecs']->table('goods') . " WHERE {$where} AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0";
        $query = $GLOBALS['db']->query($sql);
        $res = array();
        while ($row = $GLOBALS['db']->fetch_array($query)) {
            $goods['goods_id'] = $row['goods_id'];
            $goods['goods_name'] = $row['goods_name'];
            $goods['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name'];
            $goods['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
            if ($row['is_promote'] == 1 && $time > $row['promote_start_date'] && $time < $row['promote_end_date']) {
                $goods['shop_price'] = price_format($row['promote_price']);
            } else {
                $goods['shop_price'] = price_format($row['shop_price']);
            }
            $goods['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
            $str .= '<ul class="clearfix"><li class="goodsimg"><a href="' . $goods['url'] . '" target="_blank"><img src="' . $goods['goods_thumb'] . '" alt="' . $goods['goods_name'] . '" class="B_blue" /></a></li><li><a href="' . $goods['url'] . '" target="_blank" title="' . $goods['goods_name'] . '">' . $goods['short_name'] . '</a><br />' . $GLOBALS['_LANG']['shop_price'] . '<font class="f1">' . $goods['shop_price'] . '</font><br /></li></ul>';
        }
        $str .= '<ul id="clear_history"><a onclick="clear_history()">' . $GLOBALS['_LANG']['clear_history'] . '</a></ul>';
    }
    return $str;
}
开发者ID:hackjiyi,项目名称:maozishifa,代码行数:32,代码来源:lib_insert.php

示例2: get_recommended_goods

 /**
  * 取得某推荐下商品
  * @param   int     $recom_id       推荐类型
  * @param   int     $num            取商品数量
  * @param   bool    $default_image  如果商品没有图片,是否取默认图片
  * @param   int     $mall_cate_id   分类(最新商品用到)
  */
 function get_recommended_goods($recom_id, $num, $default_image = true, $mall_cate_id = 0)
 {
     $goods_list = array();
     $conditions = "g.if_show = 1 AND g.closed = 0 AND s.state = 1 ";
     if ($recom_id == REC_NEW) {
         /* 最新商品 */
         if ($mall_cate_id > 0) {
             $gcategory_mod =& m('gcategory');
             $conditions .= " AND g.cate_id " . db_create_in($gcategory_mod->get_descendant($mall_cate_id));
         }
         $sql = "SELECT g.goods_id, g.goods_name, g.default_image, gs.price, gs.stock, gs.spec_id " . "FROM " . DB_PREFIX . "goods AS g " . "LEFT JOIN " . DB_PREFIX . "goods_spec AS gs ON g.default_spec = gs.spec_id " . "LEFT JOIN " . DB_PREFIX . "store AS s ON g.store_id = s.store_id " . "WHERE " . $conditions . "ORDER BY g.add_time DESC " . "LIMIT {$num}";
     } else {
         /* 推荐商品 */
         $sql = "SELECT g.goods_id, g.goods_name, g.default_image, gs.price, gs.stock, gs.spec_id " . "FROM " . DB_PREFIX . "recommended_goods AS rg " . "   LEFT JOIN " . DB_PREFIX . "goods AS g ON rg.goods_id = g.goods_id " . "   LEFT JOIN " . DB_PREFIX . "goods_spec AS gs ON g.default_spec = gs.spec_id " . "   LEFT JOIN " . DB_PREFIX . "store AS s ON g.store_id = s.store_id " . "WHERE " . $conditions . "AND rg.recom_id = '{$recom_id}' " . "AND g.goods_id IS NOT NULL " . "ORDER BY rg.sort_order " . "LIMIT {$num}";
     }
     $res = $this->db->query($sql);
     $promotion_mod =& m('promotion');
     while ($row = $this->db->fetchRow($res)) {
         $default_image && empty($row['default_image']) && ($row['default_image'] = Conf::get('default_goods_image'));
         /* 读取促销价格 */
         $row['price'] = $promotion_mod->get_promotion_price($row['goods_id'], $row['spec_id']);
         $goods_list[] = $row;
     }
     return $goods_list;
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:32,代码来源:recommend.model.php

示例3: get_cat_id_goods_list

function get_cat_id_goods_list($cat_id = '', $num = '', $ext = '')
{
    $sql = 'Select g.goods_id,g.guige, g.cat_id,c.parent_id, g.goods_name, g.goods_number, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' . "IFNULL(mp.user_price, g.shop_price * '{$_SESSION['discount']}') AS shop_price, " . "promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, goods_img, " . "g.is_best, g.is_new, g.is_hot, g.is_promote,b.brand_name " . 'FROM ' . $GLOBALS['hhs']->table('goods') . ' AS g ' . 'LEFT JOIN ' . $GLOBALS['hhs']->table('category') . ' AS c ON c.cat_id = g.cat_id ' . "LEFT JOIN " . $GLOBALS['hhs']->table('member_price') . " AS mp " . "ON mp.goods_id = g.goods_id AND mp.user_rank = '{$_SESSION['user_rank']}' " . " left join " . $GLOBALS['hhs']->table('brand') . " as b on g.brand_id=b.brand_id " . " Where g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_new = 1 AND g.is_delete = 0 and g.is_mall=1 " . ($sql .= " AND (c.parent_id =" . $cat_id . " OR g.cat_id = " . $cat_id . " OR g.cat_id " . db_create_in(array_unique(array_merge(array($cat_id), array_keys(cat_list($cat_id, 0, false))))) . ")");
    $sql .= $ext;
    $sql .= " LIMIT {$num}";
    $res = $GLOBALS['db']->getAll($sql);
    $goods = array();
    foreach ($res as $idx => $row) {
        $goods[$idx]['id'] = $row['goods_id'];
        $goods[$idx]['name'] = $row['goods_name'];
        $goods[$idx]['guige'] = $row['guige'];
        $goods[$idx]['brief'] = $row['goods_brief'];
        $goods[$idx]['brand_name'] = $row['brand_name'];
        $goods[$idx]['goods_number'] = $row['goods_number'];
        $goods[$idx]['goods_style_name'] = add_style($row['goods_name'], $row['goods_name_style']);
        $goods[$idx]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name'];
        $goods[$idx]['short_style_name'] = add_style($goods[$idx]['short_name'], $row['goods_name_style']);
        $goods[$idx]['market_price'] = price_format($row['market_price']);
        $goods[$idx]['shop_price'] = price_format($row['shop_price']);
        $goods[$idx]['thumb'] = empty($row['goods_thumb']) ? $GLOBALS['_CFG']['no_picture'] : $row['goods_thumb'];
        $goods[$idx]['goods_img'] = empty($row['goods_img']) ? $GLOBALS['_CFG']['no_picture'] : $row['goods_img'];
        $goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
        if ($GLOBALS['SID']) {
            $goods[$idx]['shop_price'] = price_format($row['s_goods_price']);
        }
    }
    return $goods;
}
开发者ID:shiruolin,项目名称:hzzshop,代码行数:28,代码来源:index.php

示例4: __category_goods_where

 function __category_goods_where($data = array())
 {
     if (empty($data)) {
         return "";
     }
     $cid = isset($data['cid']) && intval($data['cid']) > 0 ? intval($data['cid']) : 0;
     $bid = isset($data['bid']) && intval($data['bid']) > 0 ? intval($data['bid']) : 0;
     $comd[] = "g.is_on_sale = '1' AND g.is_delete = '0' AND g.is_alone_sale='1'";
     //品牌
     if ($bid > 0) {
         //子分类
         $sub_bid = $this->get_brand_sub_cat_ids_model($bid);
         //子分类id
         $comd[] = "(b.brand_id" . db_create_in($sub_bid) . ")";
         unset($sub_bid);
     }
     if ($cid > 0) {
         //子分类
         $sub_cid = $this->get_goods_sub_cat_ids_model($cid);
         //子分类id
         $comd[] = "(g.cat_id" . db_create_in($sub_cid) . " OR csg.cat_id='{$cid}')";
         unset($sub_cid);
     }
     $w = "";
     if (!empty($comd)) {
         $w = "WHERE " . implode(' AND ', $comd);
     }
     return $w;
 }
开发者ID:zhaoshengloveqingqing,项目名称:fenxiao,代码行数:29,代码来源:model.php

示例5: get_temp_list

function get_temp_list()
{
    // Obtaion to the temp list
    $result = get_filter();
    if ($result === false) {
        $filter = array();
        $where = "WHERE 1";
        $filter['bdate'] = empty($_REQUEST['bdate']) ? date('Y-m-d') : trim($_REQUEST['bdate']);
        if (!empty($_REQUEST['city'])) {
            $where .= " AND ";
        } else {
            $where .= " AND a.country" . db_create_in(array_keys($_SESSION['city_arr']));
        }
        $where .= " AND a.order_status=1 AND b.goods_price>100";
        if ($filter['bdate']) {
            $where .= " AND a.best_time BETWEEN '" . $filter['bdate'] . " 00:00:00' AND '" . $filter['bdate'] . " 23:59:59'";
        }
        $query = "SELECT DISTINCT COUNT(*) FROM  ecs_order_info AS a \r\n\t\t\tLEFT JOIN ecs_order_goods AS b ON a.order_id=b.order_id \r\n\t\t\tLEFT JOIN order_dispatch AS c ON c.order_id=a.order_id \r\n\t\t\tLEFT JOIN ship_route AS d ON d.route_id=c.route_id {$where}";
        $filter['record_count'] = $GLOBALS['db_read']->getOne($query);
        $filter = page_and_size($filter);
        $limit = "LIMIT " . $filter['start'] . "," . $filter['page_size'] . "";
        $sql = "SELECT SUM(b.goods_number) AS gnum,c.turn,d.station_id \r\n\t\t\tFROM ecs_order_info AS a \r\n\t\t\tLEFT JOIN ecs_order_goods AS b ON a.order_id=b.order_id \r\n\t\t\tLEFT JOIN order_dispatch AS c ON c.order_id=a.order_id \r\n\t\t\tLEFT JOIN ship_route AS d ON d.route_id=c.route_id {$where} \r\n\t\t\tGROUP BY c.turn,d.station_id {$limit}";
        set_filter($filter, $sql);
    } else {
        $sql = $result['sql'];
        $filter = $result['filter'];
    }
    $list = $GLOBALS['db_read']->getAll($sql);
    return array('list' => $list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
开发者ID:songtaiwu,项目名称:mordercms,代码行数:30,代码来源:temp.php

示例6: insert_history

/**
 * 调用浏览历史
 *
 * @access  public
 * @return  string
 */
function insert_history()
{
    $str = '';
    if (!empty($_COOKIE['ECS']['history']))
    {
        $where = db_create_in($_COOKIE['ECS']['history'], 'goods_id');
        $sql   = 'SELECT goods_id, goods_name, goods_thumb, shop_price,market_price FROM ' . $GLOBALS['ecs']->table('goods') .
                " WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 limit 3";
        $query = $GLOBALS['db']->query($sql);
        $res = array();
        while ($row = $GLOBALS['db']->fetch_array($query))
        {
            $goods['goods_id'] = $row['goods_id'];
            $goods['goods_name'] = $row['goods_name'];
			$goods['market_price'] = floor($row['market_price']);
            $goods['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name'];
            $goods['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
            $goods['shop_price'] = price_format($row['shop_price']);
            $goods['url'] = build_uri('goods', array('gid'=>$row['goods_id']), $row['goods_name']);
            $str.='<ul class="clearfix" style=" height:248px;"><li class="goodsimg"><a href="'.$goods['url'].'" target="_blank"><img src="'.$goods['goods_thumb'].'" alt="'.$goods['goods_name'].'" class="B_blue" /></a></li><li><a href="'.$goods['url'].'" target="_blank" title="'.$goods['goods_name'].'">'.$goods['short_name'].'</a><br />吉采价:<font class="f1">'.$goods['shop_price'].'</font>元&nbsp;&nbsp;<i style="text-decoration:line-through;">市场价:<font class="f1">'.$goods['market_price'].'</font>元</i><br /></li></ul>';
        }
        $str .= '';
    }
    return $str;
}
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:lib_insert.php

示例7: ajax_select_goods

 function ajax_select_goods($maxattr = 0, $page = 1)
 {
     $cid = isset($_COOKIE['GZ_cid']) ? $_COOKIE['GZ_cid'] : 0;
     $subcid = array();
     if ($cid > 0) {
         $subcid = $this->action('catalog', 'get_goods_sub_cat_ids', $cid);
     }
     //分类
     ///
     isset($_COOKIE['GZ_bid']) && intval($_COOKIE['GZ_bid']) > 0 ? $comd[] = "b.brand_id = '" . intval($_COOKIE['GZ_bid']) . "'" : 0;
     //品牌
     if ($maxattr > 0) {
         for ($i = 0; $i < $maxattr; $i++) {
             isset($_COOKIE['GZ_' . $i]) && !empty($_COOKIE['GZ_' . $i]) ? $comd[] = "ga.attr_value = '" . $_COOKIE['GZ_' . $i] . "'" : 0;
             //属性
         }
     }
     if (!empty($subcid)) {
         $comd[] = "gc.cat_id " . db_create_in($subcid);
     }
     $w = !empty($comd) ? " WHERE " . implode(' AND ', $comd) : "";
     $tt = $this->__get_user_goods_select_count($w);
     $rt['count'] = $tt;
     $list = 12;
     $rt['goodslist'] = $this->__get_user_goods_select($w, $page, $list);
     $rt['goodspage'] = Import::basic()->ajax_page($tt, $list, $page, 'get_select_goods_page');
     $this->set('rt', $rt);
     $con = $this->fetch('ajax_user_goods_select', true);
     die($con);
 }
开发者ID:zhaoshengloveqingqing,项目名称:fenxiao,代码行数:30,代码来源:controller.php

示例8: get_categories_tree_pro

/**
 * 获得指定分类同级的所有分类以及该分类下的子分类
 *
 * @access  public
 * @param   integer     $cat_id     分类编号
 * @return  array
 */
function get_categories_tree_pro($cat_id = 0)
{
    if ($cat_id > 0) {
        $sql = 'SELECT parent_id FROM ' . $GLOBALS['ecs']->table('category') . " WHERE cat_id = '{$cat_id}'";
        $parent_id = $GLOBALS['db']->getOne($sql);
    } else {
        $parent_id = 0;
    }
    /*
     判断当前分类中全是是否是底级分类,
     如果是取出底级分类上级分类,
     如果不是取当前分类及其下的子分类
    */
    $sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('category') . " WHERE parent_id = '{$parent_id}' AND is_show = 1 ";
    if ($GLOBALS['db']->getOne($sql) || $parent_id == 0) {
        /* 获取当前分类及其子分类 */
        $sql = 'SELECT cat_id,cat_name ,parent_id,is_show ' . 'FROM ' . $GLOBALS['ecs']->table('category') . "WHERE parent_id = '{$parent_id}' AND is_show = 1 ORDER BY sort_order ASC, cat_id ASC";
        $res = $GLOBALS['db']->getAll($sql);
        foreach ($res as $row) {
            $cat_id = $row['cat_id'];
            $children = get_children($cat_id);
            $cat = $GLOBALS['db']->getRow('SELECT cat_name, keywords, cat_desc, style, grade, filter_attr, parent_id FROM ' . $GLOBALS['ecs']->table('category') . " WHERE cat_id = '{$cat_id}'");
            /* 获取分类下文章 */
            $sql = 'SELECT a.article_id, a.title, ac.cat_name, a.add_time, a.file_url, a.open_type FROM ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac RIGHT JOIN ' . $GLOBALS['ecs']->table('article') . " AS a ON a.cat_id=ac.cat_id AND a.is_open = 1 WHERE ac.cat_name='{$row['cat_name']}' ORDER BY a.article_type,a.article_id DESC LIMIT 4 ";
            $articles = $GLOBALS['db']->getAll($sql);
            foreach ($articles as $key => $val) {
                $articles[$key]['url'] = $val['open_type'] != 1 ? build_uri('article', array('aid' => $val['article_id']), $val['title']) : trim($val['file_url']);
            }
            /* 获取分类下品牌 */
            $sql = "SELECT b.brand_id, b.brand_name,  b.brand_logo, COUNT(*) AS goods_num, IF(b.brand_logo > '', '1', '0') AS tag " . "FROM " . $GLOBALS['ecs']->table('brand') . "AS b, " . $GLOBALS['ecs']->table('goods') . " AS g LEFT JOIN " . $GLOBALS['ecs']->table('goods_cat') . " AS gc ON g.goods_id = gc.goods_id " . "WHERE g.brand_id = b.brand_id AND ({$children} OR " . 'gc.cat_id ' . db_create_in(array_unique(array_merge(array($cat_id), array_keys(cat_list($cat_id, 0, false))))) . ") AND b.is_show = 1 " . " AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 " . "GROUP BY b.brand_id HAVING goods_num > 0 ORDER BY b.sort_order, b.brand_id ASC";
            $brands = $GLOBALS['db']->getAll($sql);
            foreach ($brands as $key => $val) {
                $temp_key = $key + 1;
                $brands[$temp_key]['brand_name'] = $val['brand_name'];
                $brands[$temp_key]['url'] = build_uri('category', array('cid' => $cat_id, 'bid' => $val['brand_id'], 'price_min' => $price_min, 'price_max' => $price_max, 'filter_attr' => $filter_attr_str), $cat['cat_name']);
                /* 判断品牌是否被选中 */
                if ($brand == $brands[$key]['brand_id']) {
                    $brands[$temp_key]['selected'] = 1;
                } else {
                    $brands[$temp_key]['selected'] = 0;
                }
            }
            unset($brands[0]);
            $cat_arr[$row['cat_id']]['brands'] = $brands;
            $cat_arr[$row['cat_id']]['articles'] = $articles;
            if ($row['is_show']) {
                $cat_arr[$row['cat_id']]['id'] = $row['cat_id'];
                $cat_arr[$row['cat_id']]['name'] = $row['cat_name'];
                $cat_arr[$row['cat_id']]['url'] = build_uri('category', array('cid' => $row['cat_id']), $row['cat_name']);
                if (isset($row['cat_id']) != NULL) {
                    $cat_arr[$row['cat_id']]['cat_id'] = get_child_tree_pro($row['cat_id']);
                }
            }
        }
    }
    if (isset($cat_arr)) {
        return $cat_arr;
    }
}
开发者ID:u0mo5,项目名称:app,代码行数:66,代码来源:lib_ecmoban.php

示例9: save_vote

/**
 * 保存投票结果信息
 *
 * @access  public
 * @param   integer     $vote_id
 * @param   string      $ip_address
 * @param   string      $option_id
 * @return  void
 */
function save_vote($vote_id, $ip_address, $option_id)
{
    $sql = "INSERT INTO " . $GLOBALS['ecs']->table('vote_log') . " (vote_id, ip_address, vote_time) " . "VALUES ('{$vote_id}', '{$ip_address}', " . gmtime() . ")";
    $res = $GLOBALS['db']->query($sql);
    /* 更新投票主题的数量 */
    $sql = "UPDATE " . $GLOBALS['ecs']->table('vote') . " SET " . "vote_count = vote_count + 1 " . "WHERE vote_id = '{$vote_id}'";
    $GLOBALS['db']->query($sql);
    /* 更新投票选项的数量 */
    $sql = "UPDATE " . $GLOBALS['ecs']->table('vote_option') . " SET " . "option_count = option_count + 1 " . "WHERE " . db_create_in($option_id, 'option_id');
    $GLOBALS['db']->query($sql);
}
开发者ID:firsteam,项目名称:falcons,代码行数:20,代码来源:vote.php

示例10: save_vote

/**
 * 保存投票结果信息.
 *
 * @param int    $vote_id
 * @param string $ip_address
 * @param string $option_id
 */
function save_vote($vote_id, $ip_address, $option_id)
{
    $sql = 'INSERT INTO ' . $GLOBALS['ecs']->table('vote_log') . ' (vote_id, ip_address, vote_time) ' . "VALUES ('{$vote_id}', '{$ip_address}', " . gmtime() . ')';
    $res = $GLOBALS['db']->query($sql);
    /* 更新投票主题的数量 */
    $sql = 'UPDATE ' . $GLOBALS['ecs']->table('vote') . ' SET ' . 'vote_count = vote_count + 1 ' . "WHERE vote_id = '{$vote_id}'";
    $GLOBALS['db']->query($sql);
    /* 更新投票选项的数量 */
    $sql = 'UPDATE ' . $GLOBALS['ecs']->table('vote_option') . ' SET ' . 'option_count = option_count + 1 ' . 'WHERE ' . db_create_in($option_id, 'option_id');
    $GLOBALS['db']->query($sql);
}
开发者ID:netroby,项目名称:ecshop,代码行数:18,代码来源:vote.php

示例11: delete

 function delete()
 {
     $ques_id = empty($_GET['id']) ? 0 : trim($_GET['id']);
     $ids = explode(',', $ques_id);
     $conditions = "1 = 1 AND ques_id " . db_create_in($ids);
     if (!($res = $this->goodsqa_mod->drop($conditions))) {
         $this->show_warning('drop_failed');
         return;
     } else {
         $this->show_warning('drop_successful', 'to_qa_list', 'index.php?app=consulting');
         return;
     }
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:13,代码来源:consulting.app.php

示例12: _get_descendant

 function _get_descendant($ids, &$ids_total)
 {
     $childs = $this->find(array('fields' => 'cate_id', 'conditions' => "parent_id " . db_create_in($ids)));
     $ids_total = array_merge($ids_total, $ids);
     $ids = array();
     foreach ($childs as $child) {
         $ids[] = $child['cate_id'];
     }
     if (empty($ids)) {
         return;
     }
     $this->_get_descendant($ids, $ids_total);
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:13,代码来源:gcategory.model.php

示例13: get_ACC

 function get_ACC($ACC_code = '')
 {
     if ($ACC_code) {
         $ACC = $this->get("code = '{$ACC_code}'");
         return isset($ACC['cate_id']) ? $ACC['cate_id'] : false;
     } else {
         $ACC_code = array(ACC_HELP, ACC_NOTICE, ACC_SYSTEM);
         $data = $this->find('code ' . db_create_in($ACC_code));
         foreach ($data as $v) {
             $ACC[$v['code']] = $v['cate_id'];
         }
         return isset($ACC) ? $ACC : false;
     }
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:14,代码来源:acategory.model.php

示例14: groupbuy

 function groupbuy()
 {
     /* 店铺信息 */
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     if (!$id) {
         $this->show_warning('Hacking Attempt');
         return;
     }
     $this->set_store($id);
     $store = $this->get_store_data();
     $this->assign('store', $store);
     /* 搜索团购 */
     empty($_GET['state']) && ($_GET['state'] = 'on');
     $conditions = '1=1';
     if ($_GET['state'] == 'on') {
         $conditions .= ' AND gb.state =' . GROUP_ON . ' AND gb.end_time>' . gmtime();
         $search_name = array(array('text' => Lang::get('group_on')), array('text' => Lang::get('all_groupbuy'), 'url' => url('app=store&act=groupbuy&state=all&id=' . $id)));
     } else {
         if ($_GET['state'] == 'all') {
             $conditions .= ' AND gb.state ' . db_create_in(array(GROUP_ON, GROUP_END, GROUP_FINISHED));
             $search_name = array(array('text' => Lang::get('all_groupbuy')), array('text' => Lang::get('group_on'), 'url' => url('app=store&act=groupbuy&state=on&id=' . $id)));
         }
     }
     $page = $this->_get_page(16);
     $groupbuy_mod =& m('groupbuy');
     $groupbuy_list = $groupbuy_mod->find(array('fields' => 'goods.default_image, gb.group_name, gb.group_id, gb.spec_price, gb.end_time, gb.state', 'join' => 'belong_goods', 'conditions' => $conditions . ' AND gb.store_id=' . $id, 'order' => 'group_id DESC', 'limit' => $page['limit'], 'count' => true));
     $page['item_count'] = $groupbuy_mod->getCount();
     $this->_format_page($page);
     $this->assign('page_info', $page);
     if (empty($groupbuy_list)) {
         $groupbuy_list = array();
     }
     foreach ($groupbuy_list as $key => $_g) {
         empty($groupbuy_list[$key]['default_image']) && ($groupbuy_list[$key]['default_image'] = Conf::get('default_goods_image'));
         $tmp = current(unserialize($_g['spec_price']));
         $groupbuy_list[$key]['price'] = $tmp['price'];
         if ($_g['end_time'] < gmtime()) {
             $groupbuy_list[$key]['group_state'] = group_state($_g['state']);
         } else {
             $groupbuy_list[$key]['lefttime'] = lefttime($_g['end_time']);
         }
     }
     /* 当前位置 */
     $this->_curlocal(LANG::get('all_stores'), 'index.php?app=search&amp;act=store', $store['store_name'], 'index.php?app=store&amp;id=' . $store['store_id'], LANG::get('groupbuy_list'));
     $this->assign('groupbuy_list', $groupbuy_list);
     $this->assign('search_name', $search_name);
     $this->_config_seo('title', $search_name[0]['text'] . ' - ' . $store['store_name']);
     $this->display('store.groupbuy.html');
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:49,代码来源:store.app.php

示例15: drop

 function drop()
 {
     if (!isset($_GET['id']) && empty($_GET['id'])) {
         $this->show_warning("involid_data");
         exit;
     }
     $ids = explode(',', trim($_GET['id']));
     $couponsn_mod =& m('couponsn');
     $couponsn_mod->unlinkRelation('bind_user', db_create_in($ids, 'coupon_sn'));
     if ($couponsn_mod->has_error()) {
         $this->show_warning($couponsn_mod->get_error());
         exit;
     }
     $this->show_message('drop_ok', 'back_list', 'index.php?app=my_coupon');
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:15,代码来源:my_coupon.app.php


注:本文中的db_create_in函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。