本文整理汇总了PHP中div_str函数的典型用法代码示例。如果您正苦于以下问题:PHP div_str函数的具体用法?PHP div_str怎么用?PHP div_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了div_str函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public function load($param)
{
$param = array("cid" => $param['cid']);
$key = $this->build_key(__CLASS__, $param);
$GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
$key_result = $GLOBALS['cache']->get($key);
if ($key_result === false) {
$param['cid'] = intval($GLOBALS['db']->getOne("select id from " . DB_PREFIX . "shop_cate where id = " . intval($param['cid'])));
$key = $this->build_key(__CLASS__, $param);
$GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
$key_result = $GLOBALS['cache']->get($key);
if ($key_result !== false) {
return $key_result;
}
$cate_id = $param['cid'];
require_once APP_ROOT_PATH . "system/utils/child.php";
$ids_util = new child("shop_cate");
$ids = $ids_util->getChildIds($cate_id);
$ids[] = $cate_id;
$deal_cate = $GLOBALS['db']->getAll("select name from " . DB_PREFIX . "shop_cate where id in (" . implode(",", $ids) . ") and is_effect = 1 and is_delete = 0");
foreach ($deal_cate as $k => $item) {
$name_words = div_str($item['name']);
foreach ($name_words as $kk => $vv) {
$kw[] = str_to_unicode_string($vv);
}
}
$key_result = implode(" ", $kw);
$GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
$GLOBALS['cache']->set($key, $key_result);
}
return $key_result;
}
示例2: index
public function index()
{
//输出团购城市
$city_list = M("DealCity")->where('is_delete = 0')->findAll();
$city_list = D("DealCity")->toFormatTree($city_list, 'name');
$this->assign("city_list", $city_list);
//分类
$cate_tree = M("DealCate")->where('is_delete = 0')->findAll();
$cate_tree = D("DealCate")->toFormatTree($cate_tree, 'name');
$this->assign("cate_tree", $cate_tree);
//开始加载搜索条件
if (intval($_REQUEST['id']) > 0) {
$map['id'] = intval($_REQUEST['id']);
}
$map['is_delete'] = 0;
if (strim($_REQUEST['name']) != '') {
$map['name'] = array('like', '%' . strim($_REQUEST['name']) . '%');
}
if (intval($_REQUEST['city_id']) > 0) {
require_once APP_ROOT_PATH . "system/utils/child.php";
$child = new Child("deal_city");
$city_ids = $child->getChildIds(intval($_REQUEST['city_id']));
$city_ids[] = intval($_REQUEST['city_id']);
$map['city_id'] = array("in", $city_ids);
}
if (intval($_REQUEST['cate_id']) > 0) {
require_once APP_ROOT_PATH . "system/utils/child.php";
$child = new Child("deal_cate");
$cate_ids = $child->getChildIds(intval($_REQUEST['cate_id']));
$cate_ids[] = intval($_REQUEST['cate_id']);
$map['cate_id'] = array("in", $cate_ids);
}
if (strim($_REQUEST['supplier_name']) != '') {
if (intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier")) < 50000) {
$sql = "select group_concat(id) from " . DB_PREFIX . "supplier where name like '%" . strim($_REQUEST['supplier_name']) . "%'";
} else {
$kws_div = div_str(trim($_REQUEST['supplier_name']));
foreach ($kws_div as $k => $item) {
$kw[$k] = str_to_unicode_string($item);
}
$kw_unicode = implode(" ", $kw);
$sql = "select group_concat(id) from " . DB_PREFIX . "supplier where (match(name_match) against('" . $kw_unicode . "' IN BOOLEAN MODE))";
}
$ids = $GLOBALS['db']->getOne($sql);
$map['supplier_id'] = array("in", $ids);
}
$map['publish_wait'] = 0;
$map['is_shop'] = 0;
if (method_exists($this, '_filter')) {
$this->_filter($map);
}
$name = $this->getActionName();
$model = D($name);
if (!empty($model)) {
$this->_list($model, $map);
}
$this->display();
return;
}
示例3: index
public function index()
{
$page_idx = intval($_REQUEST['p']) == 0 ? 1 : intval($_REQUEST['p']);
$page_size = C('PAGE_LISTROWS');
$limit = ($page_idx - 1) * $page_size . "," . $page_size;
if (isset($_REQUEST['_order'])) {
$order = $_REQUEST['_order'];
}
//排序方式默认按照倒序排列
//接受 sost参数 0 表示倒序 非0都 表示正序
if (isset($_REQUEST['_sort'])) {
$sort = $_REQUEST['_sort'] ? 'asc' : 'desc';
} else {
$sort = 'desc';
}
if (isset($order)) {
$orderby = "order by " . $order . " " . $sort;
} else {
$orderby = "";
}
if (trim($_REQUEST['name']) != '') {
$total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier");
if ($total < 50000) {
$list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier where name like '%" . trim($_REQUEST['name']) . "%' {$orderby} limit " . $limit);
$total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier where name like '%" . trim($_REQUEST['name']) . "%'");
} else {
$kws_div = div_str(trim($_REQUEST['name']));
foreach ($kws_div as $k => $item) {
$kw[$k] = str_to_unicode_string($item);
}
$kw_unicode = implode(" ", $kw);
$list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier where match(`name_match`) against('" . $kw_unicode . "' IN BOOLEAN MODE) {$orderby} limit " . $limit);
$total = $GLOBALS['db']->getOne("select * from " . DB_PREFIX . "supplier where match(`name_match`) against('" . $kw_unicode . "' IN BOOLEAN MODE)");
}
} else {
$list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier {$orderby} limit " . $limit);
$total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier");
}
$p = new Page($total, '');
$page = $p->show();
$sortImg = $sort;
//排序图标
$sortAlt = $sort == 'desc' ? l("ASC_SORT") : l("DESC_SORT");
//排序提示
$sort = $sort == 'desc' ? 1 : 0;
//排序方式
//模板赋值显示
$this->assign('sort', $sort);
$this->assign('order', $order);
$this->assign('sortImg', $sortImg);
$this->assign('sortType', $sortAlt);
$this->assign('list', $list);
$this->assign("page", $page);
$this->assign("nowPage", $p->nowPage);
$this->display();
return;
}
示例4: index
public function index()
{
require_once APP_ROOT_PATH . 'app/Lib/shop_lib.php';
$catalog_id = intval($GLOBALS['request']['catalog_id']);
//商品分类ID
$city_id = intval($GLOBALS['request']['city_id']);
//城市分类ID
$page = intval($GLOBALS['request']['page']);
//分页
$keyword = strim($GLOBALS['request']['keyword']);
$page = $page == 0 ? 1 : $page;
$page_size = PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
$condition = " deal_type = 0 ";
if ($keyword) {
$kws_div = div_str($keyword);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(tag_match,name_match,locate_match,shop_cate_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $keyword . "%')";
}
$merchant_id = intval($GLOBALS['request']['merchant_id']);
if ($merchant_id > 0) {
$deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_location_link where location_id = " . $merchant_id);
if ($deal_ids) {
$condition .= " and id in (" . $deal_ids . ") ";
}
}
$deals = get_goods_list($limit, $catalog_id, $condition, "sort desc,id desc", false, $city_id);
$list = $deals['list'];
$count = $deals['count'];
$page_total = ceil($count / $page_size);
$root = array();
$root['return'] = 1;
$goodses = array();
foreach ($list as $item) {
//$goods = array();
$goods = getGoodsArray($item);
$goodses[] = $goods;
}
$root['item'] = $goodses;
$root['page'] = array("page" => $page, "page_total" => $page_total);
output($root);
}
示例5: syn_deal
function syn_deal($deal_id)
{
$deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "crowd where id = " . $deal_id);
if ($deal_info) {
$deal_info['comment_count'] = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "crowd_comment where deal_id = " . $deal_info['id'] . " and log_id = 0"));
$deal_info['support_count'] = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "crowd_support_log where deal_id = " . $deal_info['id']));
$deal_info['focus_count'] = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "crowd_focus_log where deal_id = " . $deal_info['id']));
$deal_info['view_count'] = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "crowd_visit_log where deal_id = " . $deal_info['id']));
$deal_info['support_amount'] = doubleval($GLOBALS['db']->getOne("select sum(price) from " . DB_PREFIX . "crowd_support_log where deal_id = " . $deal_info['id']));
$deal_info['delivery_fee_amount'] = doubleval($GLOBALS['db']->getOne("select sum(delivery_fee) from " . DB_PREFIX . "crowd_order where deal_id = " . $deal_info['id'] . " and order_status=3 "));
if ($deal_info['type'] == 0) {
$deal_info["virtual_num"] = $GLOBALS['db']->getOne("select sum(virtual_person) from " . DB_PREFIX . "crowd_item where deal_id=" . $deal_id);
$deal_info["virtual_price"] = $GLOBALS['db']->getOne("select sum(virtual_person*price) from " . DB_PREFIX . "crowd_item where deal_id=" . $deal_id);
if ($deal_info['support_amount'] + $deal_info["virtual_price"] >= $deal_info['limit_price']) {
$deal_info['is_success'] = 1;
} else {
$deal_info['is_success'] = 0;
}
} elseif ($deal_info['type'] == 1) {
}
if ($deal_info['pay_radio'] > 0) {
$deal_info['pay_amount'] = $deal_info['support_amount'] * (1 - $deal_info['pay_radio']) + $deal_info['delivery_fee_amount'];
} else {
$deal_info['pay_amount'] = $deal_info['support_amount'] * (1 - app_conf("PAY_RADIO")) + $deal_info['delivery_fee_amount'];
}
$deal_info['tags_match'] = "";
$deal_info['tags_match_row'] = "";
$GLOBALS['db']->autoExecute(DB_PREFIX . "crowd", $deal_info, $mode = 'UPDATE', "id=" . $deal_info['id'], $querymode = 'SILENT');
$tags_arr = preg_split("/[, ]/", $deal_info["tags"]);
foreach ($tags_arr as $tgs) {
if (trim($tgs) != "") {
insert_match_item(trim($tgs), "crowd", $deal_info['id'], "tags_match");
}
}
$name_arr = div_str($deal_info['name']);
foreach ($name_arr as $name_item) {
if (trim($name_item) != "") {
insert_match_item(trim($name_item), "crowd", $deal_info['id'], "name_match");
}
}
}
}
示例6: index
public function index()
{
$page = intval($GLOBALS['request']['page']);
if ($page == 0) {
$page = 1;
}
$cate_id = intval($GLOBALS['request']['cate_id']);
$city_id = intval($GLOBALS['request']['city_id']);
$ytop = $latitude_top = floatval($GLOBALS['request']['latitude_top']);
//最上边纬线值 ypoint
$ybottom = $latitude_bottom = floatval($GLOBALS['request']['latitude_bottom']);
//最下边纬线值 ypoint
$xleft = $longitude_left = floatval($GLOBALS['request']['longitude_left']);
//最左边经度值 xpoint
$xright = $longitude_right = floatval($GLOBALS['request']['longitude_right']);
//最右边经度值 xpoint
$ypoint = $m_latitude = doubleval($GLOBALS['request']['m_latitude']);
//ypoint
$xpoint = $m_longitude = doubleval($GLOBALS['request']['m_longitude']);
//xpoint
$keyword = strim($GLOBALS['request']['keyword']);
if ($xpoint > 0) {
$pi = 3.14159265;
//圆周率
$r = 6378137;
//地球平均半径(米)
$field_append = ", (ACOS(SIN(({$ypoint} * {$pi}) / 180 ) *SIN((ypoint * {$pi}) / 180 ) +COS(({$ypoint} * {$pi}) / 180 ) * COS((ypoint * {$pi}) / 180 ) *COS(({$xpoint} * {$pi}) / 180 - (xpoint * {$pi}) / 180 ) ) * {$r}) as distance ";
if ($ybottom != 0 && $ytop != 0 && $xleft != 0 && $xright != 0) {
$where = " ypoint > {$ybottom} and ypoint < {$ytop} and xpoint > {$xleft} and xpoint < {$xright} ";
}
$order = " distance asc ";
} else {
$field_append = $where = $order = "";
}
$limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
if ($keyword) {
$kws_div = div_str($keyword);
foreach ($kws_div as $k => $item) {
$kw[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kw);
$where .= " (match(name_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $keyword . "%') ";
}
$res = m_search_event_list($limit, $cate_id, $city_id, $where, $order, $field_append);
$pattern = "/<img([^>]*)\\/>/i";
$replacement = "<img width=300 \$1 />";
foreach ($res['list'] as $k => $v) {
if ($v['ypoint'] == '') {
$res['list'][$k]['ypoint'] = 0;
}
if ($v['xpoint'] == '') {
$res['list'][$k]['xpoint'] = 0;
}
$res['list'][$k]['icon'] = get_abs_img_root($v['icon']);
$res['list'][$k]['distance'] = round($v['distance']);
$res['list'][$k]['date_time'] = pass_date($v['submit_begin_time']);
$res['list'][$k]['content'] = preg_replace($pattern, $replacement, get_abs_img_root($v['content']));
}
$root = array();
$root['return'] = 1;
$root['item'] = $res['list'];
$root['page'] = array("page" => $page, "page_total" => ceil($res['count'] / PAGE_SIZE));
output($root);
}
示例7: index
public function index()
{
$cid = intval($GLOBALS['request']['cid']);
$keyword = addslashes($GLOBALS['request']['tag']);
$is_hot = intval($GLOBALS['request']['is_hot']);
$is_new = intval($GLOBALS['request']['is_new']);
$page = intval($GLOBALS['request']['page']) > 0 ? intval($GLOBALS['request']['page']) : 1;
$page_size = 20;
$limit = ($page - 1) * $page_size . "," . $page_size;
$root = array();
$root['return'] = 1;
$root['tag'] = $tag;
$root['cid'] = $cid;
$condition = " 1 = 1 ";
$sort = "";
if ($is_hot > 0) {
$condition .= " and t.is_recommend = 1 and t.has_image = 1 ";
$sort .= " order by t.click_count desc,t.id desc ";
}
if ($is_new > 0) {
$condition .= " and t.has_image = 1 ";
$sort .= " order by t.create_time desc,t.id desc ";
}
if ($cid > 0) {
$condition .= " and l.cate_id = " . $cid;
}
if ($keyword) {
$kws_div = div_str($keyword);
foreach ($kws_div as $k => $item) {
$kw[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kw);
$condition .= " and match(t.keyword_match) against('" . $ukeyword . "' IN BOOLEAN MODE) ";
}
$sql = "select distinct(t.id) from " . DB_PREFIX . "topic as t left join " . DB_PREFIX . "topic_cate_link as l on l.topic_id = t.id where " . $condition . $sort . " limit " . $limit;
$sql_total = "select count(distinct(t.id)) from " . DB_PREFIX . "topic as t left join " . DB_PREFIX . "topic_cate_link as l on l.topic_id = t.id where " . $condition;
$total = $GLOBALS['db']->getOne($sql_total);
$result = $GLOBALS['db']->getAll($sql);
$share_list = array();
foreach ($result as $k => $v) {
$share_list[$k]['share_id'] = $v['id'];
$image = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic_image where topic_id = " . $v['id'] . " limit 1");
if ($image['o_path']) {
$share_list[$k]['img'] = get_abs_img_root(get_spec_image($image['o_path'], 200, 0, 0));
} else {
unset($share_list[$k]);
}
$share_list[$k]['height'] = floor($image['height'] * (200 / $image['width']));
$share_list[$k]['width'] = 200;
}
$root['item'] = array_values($share_list);
//分页
$page_info['page'] = $page;
$page_info['page_total'] = ceil($total / $page_size);
$page_info['page_size'] = $page_size;
$root['page'] = $page_info;
//广告
if ($page == 1) {
$adv_list = $GLOBALS['cache']->get("MOBILE_SHARELIST_ADVS_" . intval($GLOBALS['city_id']));
if ($adv_list === false) {
$advs = $GLOBALS['db']->getAll(" select * from " . DB_PREFIX . "m_adv where page = 'sharelist' and city_id in (0," . intval($GLOBALS['city_id']) . ") and status = 1 order by sort desc ");
$adv_list = array();
foreach ($advs as $k => $v) {
$adv_list[$k]['id'] = $v['id'];
$adv_list[$k]['name'] = $v['name'];
$adv_list[$k]['img'] = get_abs_img_root(get_spec_image($v['img'], 640, 100, 1));
$adv_list[$k]['type'] = $v['type'];
$adv_list[$k]['data'] = $v['data'] = unserialize($v['data']);
if ($v['type'] == 1) {
$tag_count = count($v['data']['tags']);
$adv_list[$k]['data']['count'] = $tag_count;
}
if (in_array($v['type'], array(9, 10, 11, 12, 13))) {
if ($v['type'] == 9 || $v['type'] == 12 || $v['type'] == 13) {
$adv_list[$k]['data']['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id = " . intval($v['data']['cate_id']));
} elseif ($v['type'] == 10) {
$adv_list[$k]['data']['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "shop_cate where id = " . intval($v['data']['cate_id']));
} elseif ($v['type'] == 11) {
$adv_list[$k]['data']['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "event_cate where id = " . intval($v['data']['cate_id']));
}
$adv_list[$k]['data']['cate_name'] = $adv_list[$k]['data']['cate_name'] ? $adv_list[$k]['data']['cate_name'] : "全部";
}
}
$GLOBALS['cache']->set("MOBILE_SHARELIST_ADVS_" . intval($GLOBALS['city_id']), $adv_list);
}
$root['advs'] = $adv_list;
}
output($root);
}
示例8: deals
//.........这里部分代码省略.........
$temp_param = $param;
$child_cate_result[$v['id']]['id'] = $v['id'];
$child_cate_result[$v['id']]['name'] = $v['name'];
$temp_param['id'] = $v['id'];
$child_cate_result[$v['id']]['url'] = url("deals", $temp_param);
if ($v['id'] == $id) {
$is_has_child = true;
}
}
}
if ($v['pid'] == $pid || $pid == 0) {
$temp_cate_ids[] = $v['id'];
}
}
}
//假如选择了子类 那么使用子类ID 否则使用 父类和其子类
if ($is_has_child) {
$cate_ids[] = $id;
} else {
$cate_ids[] = $pid;
$cate_ids = array_merge($cate_ids, $temp_cate_ids);
}
if (count($cate_ids) > 0) {
$condition .= " and d.cate_id in (" . implode(",", $cate_ids) . ")";
}
if ($loc != "") {
$condition .= " and (d.province = '" . $loc . "' or d.city = '" . $loc . "') ";
}
if ($tag != "") {
$unicode_tag = str_to_unicode_string($tag);
$condition .= " and match(d.tags_match) against('" . $unicode_tag . "' IN BOOLEAN MODE) ";
}
if ($kw != "") {
$kws_div = div_str($kw);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(d.name_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or match(d.tags_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $kw . "%') ";
}
$condition .= " and d.type={$type} ";
// if($r=="new")
// {
// $orderby =" d.begin_time desc ";
// }
// elseif($r=="rec")
// {
// $orderby.=" d.begin_time desc ";
// }
// else
// {
// $orderby =" sort asc ";
// }
//========
if ($price > 0) {
if ($price == 1) {
if ($type == 1) {
$orderby .= " d.invote_money desc";
} else {
$orderby .= " (d.support_amount+d.virtual_price) desc";
}
$param_new['price'] = 2;
} elseif ($price == 2) {
if ($type == 1) {
$orderby .= " d.invote_money asc";
} else {
示例9: index
public function index()
{
$page = intval($GLOBALS['request']['page']);
if ($page == 0) {
$page = 1;
}
$cate_id = intval($GLOBALS['request']['cate_id']);
$city_id = intval($GLOBALS['request']['city_id']);
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
$ytop = $latitude_top = floatval($GLOBALS['request']['latitude_top']);
//最上边纬线值 ypoint
$ybottom = $latitude_bottom = floatval($GLOBALS['request']['latitude_bottom']);
//最下边纬线值 ypoint
$xleft = $longitude_left = floatval($GLOBALS['request']['longitude_left']);
//最左边经度值 xpoint
$xright = $longitude_right = floatval($GLOBALS['request']['longitude_right']);
//最右边经度值 xpoint
$ypoint = $m_latitude = doubleval($GLOBALS['request']['m_latitude']);
//ypoint
$xpoint = $m_longitude = doubleval($GLOBALS['request']['m_longitude']);
//xpoint
if ($GLOBALS['request']['from'] == "wap") {
/*输出分类*/
$bigcate_list = $GLOBALS['db']->getAll("select id,name from " . DB_PREFIX . "event_cate where is_effect=1 order by sort");
/*输出商圈*/
$all_quan_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "area where city_id=" . $city_id . "");
$quan_list = array();
$quan_sub_list = array();
$quan_list[0]['id'] = 0;
$quan_list[0]['name'] = '全城';
$quan_list[0]['quan_sub'][0]['id'] = 0;
$quan_list[0]['quan_sub'][0]['pid'] = 0;
$quan_list[0]['quan_sub'][0]['name'] = '全城';
foreach ($all_quan_list as $k => $v) {
if ($v['pid'] == 0) {
$quan_list[] = $v;
}
if ($v['pid'] > 0) {
$quan_sub_list[$v['pid']][] = $v;
}
}
foreach ($quan_list as $k => $v) {
if ($v['name'] != "全城") {
if ($quan_sub_list[$v['id']] == null || $quan_sub_list[$v['id']] == '') {
$quan_list[$k]['quan_sub'] = array();
} else {
$quan_list[$k]['quan_sub'] = $quan_sub_list[$v['id']];
}
}
}
$root[quan_list] = $quan_list;
}
$keyword = strim($GLOBALS['request']['keyword']);
if ($xpoint > 0) {
$pi = 3.14159265;
//圆周率
$r = 6378137;
//地球平均半径(米)
$field_append = ", (ACOS(SIN(({$ypoint} * {$pi}) / 180 ) *SIN((ypoint * {$pi}) / 180 ) +COS(({$ypoint} * {$pi}) / 180 ) * COS((ypoint * {$pi}) / 180 ) *COS(({$xpoint} * {$pi}) / 180 - (xpoint * {$pi}) / 180 ) ) * {$r}) as distance ";
if ($ybottom != 0 && $ytop != 0 && $xleft != 0 && $xright != 0) {
$where = " ypoint > {$ybottom} and ypoint < {$ytop} and xpoint > {$xleft} and xpoint < {$xright} ";
}
$order = " distance asc,is_recommend desc,sort desc,id desc";
} else {
$field_append = $where = $order = "";
}
$limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
if ($keyword) {
$kws_div = div_str($keyword);
foreach ($kws_div as $k => $item) {
$kw[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kw);
$where .= " (match(name_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $keyword . "%') ";
}
$res = m_search_event_list($limit, $cate_id, $city_id, $where, $order, $field_append);
$pattern = "/<img([^>]*)\\/>/i";
$replacement = "<img width=300 \$1 />";
foreach ($res['list'] as $k => $v) {
if ($v['ypoint'] == '') {
$res['list'][$k]['ypoint'] = 0;
}
if ($v['xpoint'] == '') {
$res['list'][$k]['xpoint'] = 0;
}
$res['list'][$k]['icon'] = get_abs_img_root(get_spec_image($v['icon'], 140, 85, 0));
$res['list'][$k]['distance'] = round($v['distance']);
$res['list'][$k]['date_time'] = pass_date($v['submit_begin_time']);
$res['list'][$k]['event_begin_time'] = to_date($v['event_begin_time'], 'Y-m-d');
$res['list'][$k]['event_end_time'] = to_date($v['event_end_time'], 'Y-m-d');
$res['list'][$k]['submit_end_time'] = to_date($v['submit_end_time'], 'Y-m-d');
$res['list'][$k]['submit_begin_time'] = to_date($v['submit_begin_time'], 'Y-m-d');
$res['list'][$k]['content'] = preg_replace($pattern, $replacement, get_abs_img_root($v['content']));
}
$root = array();
$root['bigcate_list'] = $bigcate_list;
$root['return'] = 1;
$root['item'] = $res['list'];
$root['page'] = array("page" => $page, "page_total" => ceil($res['count'] / PAGE_SIZE), "page_size" => PAGE_SIZE);
//.........这里部分代码省略.........
示例10: index
//.........这里部分代码省略.........
$ordertype[] = array("name" => "销量最高", "sc" => "buy_count");
$ordertype[] = array("name" => "价格最高", "sc" => "price_desc");
$ordertype[] = array("name" => "价格最低", "sc" => "price_asc");
foreach ($ordertype as $k => $v) {
$tmp_url_param = $url_param;
if ($quanname) {
$tmp_url_param['quanname'] = $quanname;
}
if ($catename) {
$tmp_url_param['catename'] = $catename;
}
if ($keyword) {
$tmp_url_param['keyword'] = $keyword;
}
$tmp_url_param['order_type'] = $v['sc'];
$turl = wap_url("index", "goodslist", $tmp_url_param);
$url = str_replace('sjmapi', 'wap', $turl);
$ordertype[$k]["url"] = $url;
}
$root['ordertype'] = $ordertype;
/*排序*/
if ($order_type == 'avg_point') {
$order = " avg_point desc,id desc ";
} elseif ($order_type == 'newest') {
$order = " create_time desc,id desc ";
} elseif ($order_type == 'buy_count') {
$order = " buy_count desc,id desc ";
} elseif ($order_type == 'price_asc') {
$order = " current_price asc,id desc ";
} elseif ($order_type == 'price_desc') {
$order = " current_price desc,id desc ";
} else {
$order = "sort desc,id desc ";
}
$page = $page == 0 ? 1 : $page;
$page_size = PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
//buy_type = 0 普通商品;1积分商品
$condition = " buy_type = 0 and is_shop=1";
if ($keyword) {
$kws_div = div_str($keyword);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(tag_match,name_match,locate_match,shop_cate_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $keyword . "%')";
}
$merchant_id = intval($GLOBALS['request']['merchant_id']);
if ($merchant_id > 0) {
$deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_location_link where location_id = " . $merchant_id);
if ($deal_ids) {
$condition .= " and id in (" . $deal_ids . ") ";
} else {
$condition .= " and id ='' ";
}
}
//根据传入的商圈ID来搜索该商圈下的商品
if ($quan_id > 0) {
$condition .= " and brand_id = " . $quan_id;
}
//get_goods_list($limit,$type=array(DEAL_ONLINE,DEAL_HISTORY,DEAL_NOTICE),$param=array("cid"=>0,"city_id"=>0), $join='', $where='',$orderby = '')
$deals = get_goods_list($limit, array(DEAL_ONLINE, DEAL_HISTORY), array("cid" => $catalog_id, "city_id" => $city_id), '', $condition, $order);
$condition = $deals['condition'];
$sql = "select count(*) from " . DB_PREFIX . "deal as d where " . $condition;
$count = $GLOBALS['db']->getOne($sql);
$list = $deals['list'];
$page_total = ceil($count / $page_size);
$goodses = array();
foreach ($list as $item) {
//$goods = array();
$goods = getGoodsArray($item);
$goods['image'] = get_abs_img_root(get_spec_image($item['img'], 140, 85, 0));
$goodses[] = $goods;
}
$root['item'] = $goodses;
$root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
//$root['quan_list'] = getCityList();
/*
//输出城市
$root['city_list']=getCityList();
//输出商圈
$quan_list=getQuanList($city_id);
$root['quan_list2'] = $quan_list;
*/
//$root['bcate_list'] = $bcate_list;
//$root['quan_list'] = $quan_list;
if ($bcate_list === false) {
$root['bcate_list'] = array();
} else {
$root['bcate_list'] = $bcate_list;
}
if ($quan_list === false) {
$root['quan_list'] = array();
} else {
$root['quan_list'] = $quan_list;
}
$root['page_title'] = "商品列表";
$root['city_name'] = $city_name;
output($root);
}
示例11: index
//.........这里部分代码省略.........
// 筹资成功
// 筹资成功
case 1:
$condition .= " and end_time < " . NOW_TIME . " and support_amount >= limit_price";
$GLOBALS['tmpl']->assign("page_title", "筹资成功");
break;
// 筹资失败
// 筹资失败
case 2:
$condition .= " and end_time < " . NOW_TIME . " and support_amount < limit_price ";
$GLOBALS['tmpl']->assign("page_title", "筹资失败");
break;
// 筹资中
// 筹资中
case 3:
$condition .= " and end_time > " . NOW_TIME . " and begin_time < " . NOW_TIME . " ";
$GLOBALS['tmpl']->assign("page_title", "筹资中");
break;
}
if (count($cate_ids) > 0) {
$condition .= " and cate_id in (" . implode(",", $cate_ids) . ")";
$GLOBALS['tmpl']->assign("page_title", $cate_result[$id]['name']);
}
if ($loc != "") {
$condition .= " and (province = '" . $loc . "' or city = '" . $loc . "') ";
$GLOBALS['tmpl']->assign("page_title", $loc);
}
if ($tag != "") {
$unicode_tag = str_to_unicode_string($tag);
$condition .= " and match(tags_match) against('" . $unicode_tag . "' IN BOOLEAN MODE) ";
$GLOBALS['tmpl']->assign("page_title", $tag);
}
if ($kw != "") {
$kws_div = div_str($kw);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(name_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or match(tags_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $kw . "%') ";
$GLOBALS['tmpl']->assign("page_title", $kw);
}
// 权限浏览控制
if ($GLOBALS['user_info']['user_level'] != 0) {
$condition .= " AND (user_level ='' or user_level=0 or user_level <=" . $GLOBALS['user_info']['user_level'] . ") ";
} else {
$condition .= " AND (user_level =0 or user_level =1 or user_level ='') ";
}
$deal_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where " . $condition);
/* (所需项目)准备虚拟数据 start */
$deal_list = array();
if ($deal_count > 0) {
$now_time = get_gmtime();
// $deal_list = $GLOBALS['db']->getAll("select * from
// ".DB_PREFIX."deal where ".$condition." order by sort asc ");
$deal_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal where " . $condition . " order by sort asc limit " . $limit);
$deal_ids = array();
foreach ($deal_list as $k => $v) {
// $deal_list['percent'] =
// round($deal_list['support_amount']/$deal_list['limit_price']*100);
}
// 获取当前项目列表下的所有子项目
$temp_virtual_person_list = $GLOBALS['db']->getAll("select deal_id,virtual_person,price from " . DB_PREFIX . "deal_item where deal_id in(" . implode(",", $deal_ids) . ") ");
$virtual_person_list = array();
// 重新组装一个以项目ID为KEY的 统计所有的虚拟人数和虚拟价格
foreach ($temp_virtual_person_list as $k => $v) {
$virtual_person_list[$v['deal_id']]['total_virtual_person'] += $v['virtual_person'];
示例12: index
//.........这里部分代码省略.........
//当天就要结束
$GLOBALS['tmpl']->assign("page_title", "即将结束");
}
if ($r == "classic") {
$condition .= " and d.is_classic = 1 ";
$GLOBALS['tmpl']->assign("page_title", "经典项目");
$GLOBALS['tmpl']->assign("is_classic", true);
}
if ($r == "limit_price") {
$condition .= " and max(d.limit_price) ";
$GLOBALS['tmpl']->assign("page_title", "最高目标金额");
}
}
switch ($state) {
//筹资成功
case 1:
$condition .= " and d.is_success=1 ";
$GLOBALS['tmpl']->assign("page_title", "筹资成功");
break;
//筹资失败
//筹资失败
case 2:
$condition .= " and d.end_time < " . NOW_TIME . " and d.end_time!=0 and d.is_success=0 ";
$GLOBALS['tmpl']->assign("page_title", "筹资失败");
break;
//筹资中
//筹资中
case 3:
$condition .= " and (d.end_time > " . NOW_TIME . " or d.end_time=0 ) and d.begin_time < " . NOW_TIME . " and d.is_success=0 ";
$GLOBALS['tmpl']->assign("page_title", "筹资中");
break;
}
if (count($cate_ids) > 0) {
$condition .= " and d.cate_id in (" . implode(",", $cate_ids) . ")";
$GLOBALS['tmpl']->assign("page_title", $cate_result[$id]['name']);
}
if ($loc != "") {
$condition .= " and (d.province = '" . $loc . "' or city = '" . $loc . "') ";
$GLOBALS['tmpl']->assign("page_title", $loc);
}
if ($type !== "") {
$type = intval($type);
$condition .= " and type={$type} ";
$GLOBALS['tmpl']->assign("page_title", $loc);
}
if ($tag != "") {
$unicode_tag = str_to_unicode_string($tag);
$condition .= " and match(d.tags_match) against('" . $unicode_tag . "' IN BOOLEAN MODE) ";
$GLOBALS['tmpl']->assign("page_title", $tag);
}
if ($kw != "") {
$kws_div = div_str($kw);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(d.name_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or match(d.tags_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or d.name like '%" . $kw . "%') ";
$GLOBALS['tmpl']->assign("page_title", $kw);
}
$result = get_deal_list($limit, $condition);
foreach ($result['list'] as $key => $val) {
$result['list'][$key]['limit_ap'] = $val['limit_price'] * $val['ap_ratio'];
$result['list'][$key]['ap_amount'] = $val['support_amount'] * $val['ap_ratio'];
}
if ($type == 1) {
$GLOBALS['tmpl']->assign("deal_list_invest", $result['list']);
} else {
$GLOBALS['tmpl']->assign("deal_list", $result['list']);
}
$GLOBALS['tmpl']->assign("deal_count", $result['rs_count']);
$page = new Page($result['rs_count'], $page_size);
//初始化分页对象
$p = $page->show();
$GLOBALS['tmpl']->assign('pages', $p);
if ($type == 1) {
$GLOBALS['tmpl']->assign('deal_type', 'gq_type');
} else {
$GLOBALS['tmpl']->assign('deal_type', 'product_type');
}
if ($GLOBALS['tmpl']->_var['page_title'] == '') {
$page_title = '';
if ($type == 1) {
foreach ($GLOBALS['nav_list'] as $k => $v) {
if ($v['u_module'] == 'deals' && $v['u_action'] == 'index' && $v['u_param'] == 'type=1') {
$page_title = $v['name'];
}
}
$page_title = $page_title ? $page_title : '股权项目';
} else {
foreach ($GLOBALS['nav_list'] as $k => $v) {
if ($v['u_module'] == 'deals' && $v['u_action'] == 'index' && $v['u_param'] == '') {
$page_title = $v['name'];
}
}
$page_title = $page_title ? $page_title : '产品项目';
}
$GLOBALS['tmpl']->assign("page_title", $page_title);
}
$GLOBALS['tmpl']->display("aps_index.html");
}
示例13: index
//.........这里部分代码省略.........
break;
//筹资失败
//筹资失败
case 2:
$condition .= " and d.end_time < " . NOW_TIME . " and d.end_time!=0 and d.is_success=0 ";
$GLOBALS['tmpl']->assign("page_title", "筹资失败");
break;
//筹资中
//筹资中
case 3:
$condition .= " and (d.end_time > " . NOW_TIME . " or d.end_time=0 ) and d.begin_time < " . NOW_TIME . " ";
$GLOBALS['tmpl']->assign("page_title", "筹资中");
break;
}
if (count($cate_ids) > 0) {
$condition .= " and d.cate_id in (" . implode(",", $cate_ids) . ")";
$GLOBALS['tmpl']->assign("page_title", $cate_result[$id]['name']);
}
if ($loc != "") {
$condition .= " and (d.province = '" . $loc . "' or d.city = '" . $loc . "') ";
$GLOBALS['tmpl']->assign("page_title", $loc);
}
if ($type !== "") {
$type = intval($type);
$condition .= " and d.type={$type} ";
$GLOBALS['tmpl']->assign("page_title", $loc);
}
if ($tag != "") {
$unicode_tag = str_to_unicode_string($tag);
$condition .= " and match(d.tags_match) against('" . $unicode_tag . "' IN BOOLEAN MODE) ";
$GLOBALS['tmpl']->assign("page_title", $tag);
}
if ($kw != "") {
$kws_div = div_str($kw);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(d.name_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or match(d.tags_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or d.name like '%" . $kw . "%') ";
$GLOBALS['tmpl']->assign("page_title", $kw);
}
// if($r=="new")
// {
// $orderby =" d.begin_time desc ";
// }
// elseif($r=="rec")
// {
// $orderby.=" d.begin_time desc ";
// }
// else
// {
// $orderby =" sort asc ";
// }
$temp_param_price = array_merge($param_new, array('price' => 1));
$temp_param_focus = array_merge($param_new, array('focus' => 1));
$temp_param_time = array_merge($param_new, array('time' => 1));
$temp_param_cp = array_merge($param_new, array('cp' => 1));
$url_list = array('price_url' => url("deals", $temp_param_price), 'focus_url' => url("deals", $temp_param_focus), 'time_url' => url("deals", $temp_param_time), 'cp_url' => url("deals", $temp_param_cp));
//========
if ($price > 0) {
if ($price == 1) {
if ($type == 1) {
$orderby .= " d.invote_money desc";
} else {
$orderby .= " (d.support_amount+d.virtual_price) desc";
}
示例14: pick
//.........这里部分代码省略.........
$uname = addslashes(trim($_REQUEST['id']));
}
$cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "shop_cate where id = " . $id . " or (uname = '" . $uname . "' and uname <> '')");
$condition = " d.buy_type<>1 ";
//条件
$ids = load_auto_cache("shop_sub_cate_ids", array("cate_id" => intval($cate_item['id'])));
$add_title = "";
//输出品牌
$brand_id = intval($_REQUEST['b']);
if ($brand_id > 0) {
$condition .= " and d.brand_id = " . $brand_id;
$add_title .= $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "brand where id = " . $brand_id);
$GLOBALS['tmpl']->assign("brand_id", $brand_id);
}
$brand_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "brand order by sort desc");
$GLOBALS['tmpl']->assign("brand_list", $brand_list);
//输出属性筛选
$filter_req = $_REQUEST['f'];
$join_str = "";
$unicode_tags = array();
foreach ($filter_req as $k => $v) {
$filter_req[$k] = trim(addslashes(urldecode($v)));
if ($filter_req[$k] != '' && $filter_req[$k] != 'all') {
if ($add_title != '') {
$add_title .= " - ";
}
$add_title .= $filter_req[$k];
// //联表及条件
// $join_str.=" left join ".DB_PREFIX."deal_filter as df_".$k." on d.id=df_".$k.".deal_id and df_".$k.".filter_group_id = ".$k;
// $condition.=" and df_".$k.".filter like '%".$filter_req[$k]."%' ";
$unicode_tags[] = "+" . str_to_unicode_string($filter_req[$k]);
}
}
if (count($unicode_tags) > 0) {
$kw_unicode = implode(" ", $unicode_tags);
//有筛选
$condition .= " and (match(d.tag_match) against('" . $kw_unicode . "' IN BOOLEAN MODE))";
}
if (intval($_REQUEST['id']) != 0) {
$filter_group = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "filter_group where is_effect = 1 and cate_id in (" . implode(",", $ids) . ") order by sort desc");
foreach ($filter_group as $k => $v) {
$filter_group[$k]['value'] = $filter_req[$v['id']];
}
$GLOBALS['tmpl']->assign("filter_group", $filter_group);
}
//输出价格区间
$min_price = doubleval($_REQUEST['min_price']);
$max_price = doubleval($_REQUEST['max_price']);
$GLOBALS['tmpl']->assign("min_price", $min_price);
$GLOBALS['tmpl']->assign("max_price", $max_price);
if ($min_price > 0) {
$condition .= " and d.current_price >= " . $min_price;
}
if ($max_price > 0) {
$condition .= " and d.current_price <= " . $max_price;
}
$sort_field = es_cookie::get("shop_sort_field") ? es_cookie::get("shop_sort_field") : "sort";
$sort_type = es_cookie::get("shop_sort_type") ? es_cookie::get("shop_sort_type") : "desc";
$GLOBALS['tmpl']->assign('sort_field', $sort_field);
$GLOBALS['tmpl']->assign('sort_type', $sort_type);
if (es_cookie::get("list_type") === null) {
$list_type = app_conf("LIST_TYPE");
} else {
$list_type = intval(es_cookie::get("list_type"));
}
$GLOBALS['tmpl']->assign("list_type", $list_type);
$kw = addslashes(htmlspecialchars(trim($_REQUEST['keyword'])));
if ($kw != '') {
$GLOBALS['tmpl']->assign('keyword', $kw);
if ($add_title != '') {
$add_title .= "-";
}
$add_title .= $kw;
$kws_div = div_str($kw);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(d.tag_match,d.name_match,d.locate_match,d.shop_cate_match) against('" . $ukeyword . "' IN BOOLEAN MODE))";
//$condition.=" and (d.name like '%".$kw."%' or d.sub_name like '%".$kw."%' or d.brief like '%".$kw."%' or d.description like '%".$kw."%')";
}
if ($add_title != '') {
$add_title .= "-";
}
$add_title .= $GLOBALS['lang']['GOODS_SEARCH'];
$result = search_goods_list($limit, intval($cate_item['id']), $condition, "d." . $sort_field . " " . $sort_type, false, $join_str);
$GLOBALS['tmpl']->assign("list", $result['list']);
$page = new Page($result['count'], app_conf("DEAL_PAGE_SIZE"));
//初始化分页对象
$p = $page->show();
$GLOBALS['tmpl']->assign('pages', $p);
$GLOBALS['tmpl']->assign("cate_id", $cate_item['id']);
$GLOBALS['tmpl']->assign("page_title", $add_title . $cate_item['name']);
$GLOBALS['tmpl']->assign("page_keyword", $add_title . $cate_item['name'] . ",");
$GLOBALS['tmpl']->assign("page_description", $add_title . $cate_item['name'] . ",");
$GLOBALS['tmpl']->assign("filter", true);
//显示筛选框
$GLOBALS['tmpl']->assign("show_list", true);
$GLOBALS['tmpl']->display("ss_index.html");
}
示例15: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$root = array();
$email = strim($GLOBALS['request']['biz_email']);
//用户名或邮箱
$pwd = strim($GLOBALS['request']['biz_pwd']);
//密码
$user_qrcode = strim($GLOBALS['request']['user_qrcode']);
//会员二维码
$page = intval($GLOBALS['request']['page']);
//分页
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
$keyword = strim($GLOBALS['request']['keyword']);
//查询关键字
//检查用户,用户密码
$biz_user = biz_check($email, $pwd);
$supplier_id = intval($biz_user['supplier_id']);
if ($supplier_id > 0) {
$root['user_login_status'] = 1;
//用户登陆状态:1:成功登陆;0:未成功登陆
$time = get_gmtime();
$sql = "select id, user_name, user_qrcode, qrcode_end from " . DB_PREFIX . "user where user_qrcode = '" . $user_qrcode . "' limit 1";
$user = $GLOBALS['db']->getRow($sql);
if (!$user) {
$root['return'] = 0;
$root['info'] = "会员卡不存在";
output($root);
} else {
if ($user['qrcode_end'] < $time) {
$root['return'] = 0;
$root['info'] = "会员卡已过期";
output($root);
}
}
$root['user_id'] = $user['id'];
$root['user_qrcode'] = $user['user_qrcode'];
$root['user_name'] = $user['user_name'];
$sql = "select d.id,d.name,d.sub_name,d.icon, d.current_price,d.return_qrcode_money from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_location_link as l on l.deal_id = d.id where ";
$count_sql = "select count(d.id) from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_location_link as l on l.deal_id = d.id where ";
$condition = " d.is_shop in (0,1) and l.location_id in (" . implode(",", $biz_user['location_ids']) . ") and d.is_delete = 0 and d.supplier_id = " . $supplier_id . " and d.buy_type = 0 and d.publish_wait = 0 ";
$condition .= " and ((" . $time . ">= d.begin_time or d.begin_time = 0) and (" . $time . "< d.end_time or d.end_time = 0) and d.buy_status <> 2) ";
//$condition .= " and d.return_qrcode_money > 0";
if ($keyword) {
$kws_div = div_str($keyword);
foreach ($kws_div as $k => $item) {
$kws[$k] = str_to_unicode_string($item);
}
$ukeyword = implode(" ", $kws);
$condition .= " and (match(d.tag_match,d.name_match,d.locate_match,d.deal_cate_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or d.name like '%" . $keyword . "%') ";
}
$sql .= $condition . " order by d.id desc limit " . $limit;
//$root['sql'] = $sql;
$count_sql .= $condition;
//print_r($biz_user);
//echo $sql; exit;
$deal_list = $GLOBALS['db']->getAll($sql);
foreach ($deal_list as $k => $v) {
$deal_list[$k]['icon'] = get_abs_img_root(get_spec_image($v['icon'], 360, 288, 0));
$deal_list[$k]['current_price_format'] = format_price($v['current_price']);
$deal_list[$k]['return_qrcode_money_format'] = format_price($v['return_qrcode_money']);
$deal_list[$k]['allow_edit_total_money'] = 1;
//允许下单时,直接编辑商品总价
}
$deal_count = $GLOBALS['db']->getOne($count_sql);
$root['page'] = array("page" => $page, "page_total" => ceil($deal_count / PAGE_SIZE), "page_size" => PAGE_SIZE);
if ($deal_list == false || $deal_list == null) {
$deal_list = array();
}
$root['item'] = $deal_list;
$root['return'] = 1;
$root['info'] = "商品列表";
} else {
$root['return'] = 0;
$root['user_login_status'] = 0;
//用户登陆状态:1:成功登陆;0:未成功登陆
$root['info'] = "商户不存在或密码错误";
}
output($root);
}