本文整理汇总了PHP中set_medias函数的典型用法代码示例。如果您正苦于以下问题:PHP set_medias函数的具体用法?PHP set_medias怎么用?PHP set_medias使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_medias函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategory
public function getCategory()
{
global $_W;
$shopset = m('common')->getSysset('shop');
$allcategory = array();
$category = pdo_fetchall("SELECT * FROM " . tablename('ewei_shop_category') . " WHERE uniacid=:uniacid and enabled=1 ORDER BY parentid ASC, displayorder DESC", array(':uniacid' => $_W['uniacid']));
$category = set_medias($category, array('thumb', 'advimg'));
foreach ($category as $c) {
if (empty($c['parentid'])) {
$children = array();
foreach ($category as $c1) {
if ($c1['parentid'] == $c['id']) {
if (intval($shopset['catlevel']) == 3) {
$children2 = array();
foreach ($category as $c2) {
if ($c2['parentid'] == $c1['id']) {
$children2[] = $c2;
}
}
$c1['children'] = $children2;
}
$children[] = $c1;
}
}
$c['children'] = $children;
$allcategory[] = $c;
}
}
return $allcategory;
}
示例2: getData
public function getData($page)
{
global $_W;
$data = htmlspecialchars_decode($page['datas']);
$d = json_decode($data, true);
$goodsids = array();
foreach ($d as $k1 => &$dd) {
if ($dd['temp'] == 'goods') {
foreach ($dd['data'] as $k2 => $ddd) {
$goodsids[] = array('id' => $ddd['goodid'], 'k1' => $k1, 'k2' => $k2);
}
} elseif ($dd['temp'] == 'richtext') {
$dd['content'] = $this->unescape($dd['content']);
}
}
unset($dd);
$arr = array();
foreach ($goodsids as $a) {
$arr[] = $a['id'];
}
if (count($arr) > 0) {
$goodinfos = pdo_fetchall("SELECT id,title,productprice,marketprice,thumb FROM " . tablename('ewei_shop_goods') . " WHERE id in ( " . implode(',', $arr) . ") and uniacid= :uniacid ", array(':uniacid' => $_W['uniacid']), 'id');
$goodinfos = set_medias($goodinfos, 'thumb');
foreach ($d as $k1 => &$dd) {
if ($dd['temp'] == 'goods') {
foreach ($dd['data'] as $k2 => &$ddd) {
$cdata = $goodinfos[$ddd['goodid']];
$ddd['name'] = $cdata['title'];
$ddd['priceold'] = $cdata['productprice'];
$ddd['pricenow'] = $cdata['marketprice'];
$ddd['img'] = $cdata['thumb'];
}
unset($ddd);
}
}
unset($dd);
}
$data = json_encode($d);
$data = rtrim($data, "]");
$data = ltrim($data, "[");
$pageinfo = htmlspecialchars_decode($page['pageinfo']);
$p = json_decode($pageinfo, true);
$page_title = empty($p[0]['params']['title']) ? "未设置页面标题" : $p[0]['params']['title'];
$page_desc = empty($p[0]['params']['desc']) ? "未设置页面简介" : $p[0]['params']['desc'];
$page_img = empty($p[0]['params']['img']) ? "" : tomedia($p[0]['params']['img']);
$page_keyword = empty($p[0]['params']['kw']) ? "" : $p[0]['params']['kw'];
$shopset = m('common')->getSysset('shop');
$system = array('shopname' => $shopset['name'], 'shoplogo' => tomedia($shopset['logo']));
$system = json_encode($system);
return array('page' => $page, 'data' => $data, 'share' => array('title' => $page_title, 'desc' => $page_desc, 'imgUrl' => $page_img), 'footermenu' => intval($p[0]['params']['footer']), 'system' => $system);
}
示例3: respond
public function respond($obj = null)
{
global $_W;
$message = $obj->message;
$content = $obj->message['content'];
$msgtype = strtolower($message['msgtype']);
$event = strtolower($message['event']);
if ($msgtype == 'text' || $event == 'click') {
$page = pdo_fetch('select * from ' . tablename('ewei_shop_designer') . ' where keyword=:keyword and uniacid=:uniacid limit 1', array(':uniacid' => $_W['uniacid'], ':keyword' => $content));
if (empty($page)) {
return $this->responseEmpty();
}
$p = htmlspecialchars_decode($page['pageinfo']);
$p = json_decode($p, true);
$r_title = empty($p[0]['params']['title']) ? "未设置标题" : $p[0]['params']['title'];
$r_desc = empty($p[0]['params']['desc']) ? "未设置页面介绍" : $p[0]['params']['desc'];
$r_img = empty($p[0]['params']['img']) ? "" : $p[0]['params']['img'];
$r_img = set_medias($r_img);
$news = array(array('title' => $r_title, 'picurl' => $r_img, 'description' => $r_desc, 'url' => $_W['siteroot'] . 'app/index.php?i=' . $_W['uniacid'] . '&c=entry&m=ewei_shop&do=plugin&p=designer&pageid=' . $page['id']));
return $obj->respNews($news);
}
return $this->responseEmpty();
}
示例4: array_merge
$storeids = array_merge(explode(',', $g['storeids']), $storeids);
}
}
if (!empty($storeids)) {
if (!empty($saler['storeid'])) {
if (!in_array($saler['storeid'], $storeids)) {
show_json(0, '您无此门店的核销权限!');
}
}
}
$goods = set_medias($goods, 'thumb');
$order['goodstotal'] = count($goods);
$order['finishtime'] = date('Y-m-d H:i:s', $order['finishtime']);
$address = false;
$carrier = unserialize($order['carrier']);
$set = set_medias(m('common')->getSysset('shop'), 'logo');
show_json(1, array('order' => $order, 'goods' => $goods, 'carrier' => $carrier, 'set' => $set));
} else {
if ($operation == 'complete') {
$orderid = intval($_GPC['id']);
$saler = pdo_fetch('select * from ' . tablename('ewei_shop_saler') . ' where openid=:openid and uniacid=:uniacid limit 1', array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
if (empty($saler)) {
show_json(0, '您无核销权限!');
}
$order = pdo_fetch('select * from ' . tablename('ewei_shop_order') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $orderid, ':uniacid' => $uniacid));
if (empty($order)) {
show_json(0, "订单不存在!");
}
if (empty($order['isverify'])) {
show_json(0, "订单无需核销!");
}
示例5: getGuide
public function getGuide($system, $pageinfo)
{
global $_W, $_GPC;
if (!empty($_GPC['preview'])) {
$guide['followed'] = '0';
} else {
$guide['openid2'] = m('user')->getOpenid();
$guide['followed'] = m('user')->followed($guide['openid2']);
}
if ($guide['followed'] != '1') {
$system = json_decode($system, true);
$system['shop'] = set_medias($system['shop'], 'logo');
$pageinfo = json_decode($pageinfo, true);
if (!empty($_GPC['mid'])) {
$guide['member1'] = pdo_fetch("SELECT id,nickname,openid,avatar FROM " . tablename('ewei_shop_member') . " WHERE id=:mid and uniacid= :uniacid limit 1 ", array(':uniacid' => $_W['uniacid'], ':mid' => $_GPC['mid']));
$guide['member2'] = pdo_fetch("SELECT id,nickname,openid FROM " . tablename('ewei_shop_member') . " WHERE openid=:openid and uniacid= :uniacid limit 1 ", array(':uniacid' => $_W['uniacid'], ':openid' => $guide['openid2']));
}
$guide['followurl'] = $system['share']['followurl'];
if (empty($guide['member1'])) {
$guide['title1'] = $pageinfo['params']['guidetitle1'];
$guide['title2'] = $pageinfo['params']['guidetitle2'];
$guide['logo'] = $system['shop']['logo'];
} else {
$pageinfo['params']['guidetitle1s'] = str_replace("[邀请人]", $guide['member1']['nickname'], $pageinfo['params']['guidetitle1s']);
$pageinfo['params']['guidetitle2s'] = str_replace("[邀请人]", $guide['member1']['nickname'], $pageinfo['params']['guidetitle2s']);
$pageinfo['params']['guidetitle1s'] = str_replace("[访问者]", $guide['member2']['nickname'], $pageinfo['params']['guidetitle1s']);
$pageinfo['params']['guidetitle2s'] = str_replace("[访问者]", $guide['member2']['nickname'], $pageinfo['params']['guidetitle2s']);
$guide['title1'] = $pageinfo['params']['guidetitle1s'];
$guide['title2'] = $pageinfo['params']['guidetitle2s'];
$guide['logo'] = $guide['member1']['avatar'];
}
}
return $guide;
}
示例6: getGoods
public function getGoods($id, $member)
{
global $_W;
$credit = $member['credit1'];
$money = $member['credit2'];
if (empty($id)) {
return array('canbuy' => false, 'buymsg' => '已下架');
}
$goods = pdo_fetch('select * from ' . tablename('ewei_shop_creditshop_goods') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $id, ':uniacid' => $_W['uniacid']));
if (empty($goods)) {
return array('canbuy' => false, 'buymsg' => '已下架');
}
$goods = set_medias($goods, 'thumb');
if ($goods['credit'] > 0 & $goods['money'] > 0) {
$goods['acttype'] = 0;
} else {
if ($goods['credit'] > 0) {
$goods['acttype'] = 1;
} else {
if ($goods['money'] > 0) {
$goods['acttype'] = 2;
}
}
}
$goods['endtime_str'] = date('Y-m-d H:i', $goods['endtime']);
$goods['timestart_str'] = date('Y-m-d H:i', $goods['timestart']);
$goods['timeend_str'] = date('Y-m-d H:i', $goods['timeend']);
$goods['timestate'] = "";
$goods['canbuy'] = !empty($goods['status']) && empty($goods['deleted']);
if (empty($goods['canbuy'])) {
$goods['buymsg'] = "已下架";
} else {
if ($goods['total'] > 0) {
$logcount = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_creditshop_log') . " where goodsid=:goodsid and status>=2 and uniacid=:uniacid ", array(':goodsid' => $id, ':uniacid' => $_W['uniacid']));
if ($logcount >= $goods['total']) {
$goods['canbuy'] = false;
$goods['buymsg'] = empty($goods['type']) ? '已兑完' : '已抽完';
}
}
if ($goods['canbuy']) {
if ($goods['totalday'] > 0) {
$logcount = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_creditshop_log') . " where goodsid=:goodsid and status>=2 and date_format(from_UNIXTIME(`createtime`),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and uniacid=:uniacid ", array(':goodsid' => $id, ':uniacid' => $_W['uniacid']));
if ($logcount >= $goods['totalday']) {
$goods['canbuy'] = false;
$goods['buymsg'] = empty($goods['type']) ? '今日已兑完' : '今日已抽完';
}
}
}
if ($goods['canbuy']) {
if ($goods['chanceday'] > 0) {
$logcount = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_creditshop_log') . " where goodsid=:goodsid and openid=:openid and status>0 and date_format(from_UNIXTIME(`createtime`),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and uniacid=:uniacid ", array(':goodsid' => $id, ':uniacid' => $_W['uniacid'], ':openid' => $member['openid']));
if ($logcount >= $goods['chanceday']) {
$goods['canbuy'] = false;
$goods['buymsg'] = empty($goods['type']) ? '今日已兑换' : '今日已抽奖';
}
}
}
if ($goods['canbuy']) {
if ($goods['chance'] > 0) {
$logcount = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_creditshop_log') . ' where goodsid=:goodsid and openid=:openid and status>0 and uniacid=:uniacid ', array(':goodsid' => $id, ':uniacid' => $_W['uniacid'], ':openid' => $member['openid']));
if ($logcount >= $goods['chance']) {
$goods['canbuy'] = false;
$goods['buymsg'] = empty($goods['type']) ? '已兑换' : '已抽奖';
}
}
}
if ($goods['canbuy']) {
if ($goods['usermaxbuy'] > 0) {
$logcount = pdo_fetchcolumn('select ifnull(sum(total),0) from ' . tablename('ewei_shop_creditshop_log') . ' where goodsid=:goodsid and openid=:openid and uniacid=:uniacid ', array(':goodsid' => $id, ':uniacid' => $_W['uniacid'], ':openid' => $member['openid']));
if ($logcount >= $goods['chance']) {
$goods['canbuy'] = false;
$goods['buymsg'] = '已参加';
}
}
}
if ($goods['canbuy']) {
if ($credit < $goods['credit'] && $goods['credit'] > 0) {
$goods['canbuy'] = false;
$goods['buymsg'] = "积分不足";
}
}
if ($goods['canbuy']) {
if ($goods['istime'] == 1) {
if (time() < $goods['timestart']) {
$goods['canbuy'] = false;
$goods['timestate'] = "before";
$goods['buymsg'] = "活动未开始";
} else {
if (time() > $goods['timeend']) {
$goods['canbuy'] = false;
$goods['buymsg'] = '活动已结束';
} else {
$goods['timestate'] = "after";
}
}
}
}
$levelid = $member['level'];
$groupid = $member['groupid'];
if ($goods['canbuy']) {
//.........这里部分代码省略.........
示例7: exit
<?php
if (!defined('IN_IA')) {
exit('Access Denied');
}
global $_W, $_GPC;
$operation = !empty($_GPC['op']) ? $_GPC['op'] : 'index';
$openid = m('user')->getOpenid();
$uniacid = $_W['uniacid'];
$set = m('common')->getSysset('shop');
$commission = p('commission');
if ($commission) {
$shopid = intval($_GPC['shopid']);
if (!empty($shopid)) {
$myshop = set_medias($commission->getShop($shopid), array('img', 'logo'));
}
}
if ($_W['isajax']) {
$args = array('pagesize' => 10, 'page' => $_GPC['page'], 'isnew' => $_GPC['isnew'], 'ishot' => $_GPC['ishot'], 'isrecommand' => $_GPC['isrecommand'], 'isdiscount' => $_GPC['isdiscount'], 'istime' => $_GPC['istime'], 'keywords' => $_GPC['keywords'], 'pcate' => $_GPC['pcate'], 'ccate' => $_GPC['ccate'], 'tcate' => $_GPC['tcate'], 'order' => $_GPC['order'], 'by' => $_GPC['by']);
if (!empty($myshop['selectgoods']) && !empty($myshop['goodsids'])) {
$args['ids'] = $myshop['goodsids'];
}
$goods = m('goods')->getList($args);
show_json(1, array('goods' => $goods, 'pagesize' => $args['pagesize']));
}
include $this->template('shop/list');
示例8: getComments
public function getComments($goodsid = '0', $args = array())
{
global $_W;
$page = !empty($args['page']) ? intval($args['page']) : 1;
$pagesize = !empty($args['pagesize']) ? intval($args['pagesize']) : 10;
$condition = ' and `uniacid` = :uniacid AND `goodsid` = :goodsid and deleted=0';
$params = array(':uniacid' => $_W['uniacid'], ':goodsid' => $goodsid);
$sql = "SELECT id,nickname,headimgurl,content,images FROM " . tablename('ewei_shop_goods_comment') . " where 1 {$condition} ORDER BY createtime desc LIMIT " . ($page - 1) * $pagesize . ',' . $pagesize;
$list = pdo_fetchall($sql, $params);
foreach ($list as &$row) {
$row['images'] = set_medias(unserialize($row['images']));
}
unset($row);
return $list;
}
示例9: m
<?php
//微赞科技 by QQ:800083075 http://www.012wz.com/
global $_W, $_GPC;
$openid = m('user')->getOpenid();
$shop_set = m('common')->getSysset('shop');
$set = set_medias($this->set, 'regbg');
$member = m('member')->getInfo($openid);
if ($member['isagent'] == 1 && $member['status'] == 1) {
header("location: " . $this->createPluginMobileUrl('commission'));
die;
}
$mid = intval($_GPC['mid']);
if ($_W['isajax']) {
$agent = false;
if (!empty($member['agentid'])) {
$mid = $member['agentid'];
$agent = m('member')->getMember($member['agentid']);
} else {
if (!empty($mid)) {
$agent = m('member')->getMember($mid);
}
}
$ret = array('shop_set' => $shop_set, 'set' => $set, 'member' => $member, 'agent' => $agent);
$ret['status'] = 0;
$status = intval($set['become_order']) == 0 ? 1 : 3;
if ($set['become'] == '2') {
$ordercount = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_order') . " where uniacid=:uniacid and openid=:openid and status>={$status} limit 1", array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
if ($ordercount < intval($set['become_ordercount'])) {
$ret['status'] = 1;
$ret['order'] = number_format($ordercount, 0);
示例10: show_json
if ($it['id'] == $itemid) {
$specs[] = $ss;
break;
}
}
}
}
}
show_json(1, array('cartdata' => $cartdata, 'cartoption' => $cartoption, 'cartspecs' => $cartspecs, 'goods' => $goods, 'options' => $options, 'specs' => $specs));
} else {
if ($operation == 'setoption' && $_W['ispost']) {
$id = intval($_GPC['id']);
$goodsid = intval($_GPC['goodsid']);
$optionid = intval($_GPC['optionid']);
$option = pdo_fetch("select id,title,thumb,marketprice,productprice,costprice, stock,weight,specs from " . tablename('ewei_shop_goods_option') . " " . " where uniacid=:uniacid and goodsid=:goodsid and id=:id limit 1 ", array(':id' => $optionid, ':uniacid' => $uniacid, ':goodsid' => $goodsid));
$option = set_medias($option, 'thumb');
if (empty($option)) {
show_json(0, '规格未找到');
}
pdo_update('ewei_shop_member_cart', array('optionid' => $optionid), array('id' => $id, 'uniacid' => $uniacid, 'goodsid' => $goodsid));
show_json(1, array('optionid' => $optionid, 'optiontitle' => $option['title']));
} else {
if ($operation == 'updatenum' && $_W['ispost']) {
$id = intval($_GPC['id']);
$goodsid = intval($_GPC['goodsid']);
$total = intval($_GPC['total']);
empty($total) && ($total = 1);
$data = pdo_fetchall("select id,total from " . tablename('ewei_shop_member_cart') . " " . " where id=:id and uniacid=:uniacid and goodsid=:goodsid and openid=:openid limit 1 ", array(':id' => $id, ':uniacid' => $uniacid, ':goodsid' => $goodsid, ':openid' => $openid));
if (empty($data)) {
show_json(0, '购物车数据未找到');
}
示例11: unset
if (!empty($og['option_goodssn'])) {
$og['goodssn'] = $og['option_goodssn'];
}
if (!empty($og['option_productsn'])) {
$og['productsn'] = $og['option_productsn'];
}
if (!empty($og['goodssn'])) {
$goods .= ' 商品编号: ' . $og['goodssn'];
}
if (!empty($og['productsn'])) {
$goods .= ' 商品条码: ' . $og['productsn'];
}
$goods .= ' 单价: ' . $og['price'] / $og['total'] . ' 折扣后: ' . $og['realprice'] / $og['total'] . ' 数量: ' . $og['total'] . ' 总价: ' . $og['price'] . " 折扣后: " . $og['realprice'] . "\r\n ";
}
unset($og);
$value['goods'] = set_medias($order_goods, 'thumb');
$value['goods_str'] = $goods;
if (!empty($agentid) && $level > 0) {
$commission_level = 0;
if ($value['agentid'] == $agentid) {
$value['level'] = 1;
$level1_commissions = pdo_fetchall('select commission1 from ' . tablename('ewei_shop_order_goods') . ' og ' . ' left join ' . tablename('ewei_shop_order') . ' o on o.id = og.orderid ' . ' where og.orderid=:orderid and o.agentid= ' . $agentid . " and o.uniacid=:uniacid", array(':orderid' => $value['id'], ':uniacid' => $_W['uniacid']));
foreach ($level1_commissions as $c) {
$commission = iunserializer($c['commission1']);
$commission_level += isset($commission['level' . $agentLevel['id']]) ? $commission['level' . $agentLevel['id']] : $commission['default'];
}
} else {
if (in_array($value['agentid'], array_keys($agent['level1_agentids']))) {
$value['level'] = 2;
if ($agent['level2'] > 0) {
$level2_commissions = pdo_fetchall('select commission2 from ' . tablename('ewei_shop_order_goods') . ' og ' . ' left join ' . tablename('ewei_shop_order') . ' o on o.id = og.orderid ' . ' where og.orderid=:orderid and o.agentid in ( ' . implode(',', array_keys($agent['level1_agentids'])) . ") and o.uniacid=:uniacid", array(':orderid' => $value['id'], ':uniacid' => $_W['uniacid']));
示例12: exit
<?php
if (!defined('IN_IA')) {
exit('Access Denied');
}
global $_W, $_GPC;
$kwd = trim($_GPC['keyword']);
$params = array();
$params[':uniacid'] = $_W['uniacid'];
$condition = " and uniacid=:uniacid";
if (!empty($kwd)) {
$condition .= " AND `title` LIKE :keyword";
$params[':keyword'] = "%{$kwd}%";
}
$ds = pdo_fetchall('SELECT id,title,thumb FROM ' . tablename('ewei_shop_goods') . " WHERE 1 {$condition} order by createtime desc", $params);
$ds = set_medias($ds, 'thumb');
include $this->template('web/shop/query');
示例13: array
$condition = " and openid=:openid and userdeleted=0 and deleted=0 and uniacid=:uniacid ";
$params = array(':uniacid' => $uniacid, ':openid' => $openid);
if ($status != '') {
if ($status != 4) {
$condition .= ' and status=' . intval($status);
} else {
$condition .= ' and refundid<>0';
}
} else {
$condition .= ' and status<>-1';
}
$list = pdo_fetchall("select id,ordersn,price,status,iscomment,isverify,verified,iscomment,refundid,expresscom,express,expresssn from " . tablename('ewei_shop_order') . " where 1 {$condition} order by createtime desc LIMIT " . ($pindex - 1) * $psize . ',' . $psize, $params);
$total = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_order') . " where 1 {$condition}", $params);
foreach ($list as &$row) {
$sql = 'SELECT og.goodsid,og.total,g.title,g.thumb,og.price,og.optionname as optiontitle,og.optionid FROM ' . tablename('ewei_shop_order_goods') . ' og ' . ' left join ' . tablename('ewei_shop_goods') . ' g on og.goodsid = g.id ' . ' where og.orderid=:orderid order by og.id asc';
$row['goods'] = set_medias(pdo_fetchall($sql, array(':orderid' => $row['id'])), 'thumb');
$row['goodscount'] = count($row['goods']);
switch ($row['status']) {
case "-1":
$status = "已取消";
break;
case "0":
$status = "待付款";
break;
case "1":
$status = "待发货";
break;
case "2":
$status = "待收货";
break;
case "3":
示例14: array
if (empty($set['become_reg']) && (empty($member['realname']) || empty($member['mobile']))) {
$trigger = true;
}
} else {
if (!empty($_GPC['mid'])) {
$_W['shopshare']['link'] = $this->createMobileUrl('shop', array('mid' => $_GPC['mid']));
}
}
}
}
include $this->template('shop/index_diy');
exit;
}
}
$set = set_medias(m('common')->getSysset('shop'), array('logo', 'img'));
if ($_W['isajax']) {
if ($operation == 'index') {
$advs = pdo_fetchall("select id,advname,link,thumb from " . tablename('ewei_shop_adv') . ' where uniacid=:uniacid and enabled=1 order by displayorder desc', array(':uniacid' => $uniacid));
$advs = set_medias($advs, 'thumb');
show_json(1, array('set' => $set, 'advs' => $advs));
} else {
if ($operation == 'goods') {
$type = $_GPC['type'];
$args = array('page' => $_GPC['page'], 'pagesize' => 6, 'isrecommand' => 1, 'order' => 'displayorder desc,createtime desc', 'by' => '');
$goods = m('goods')->getList($args);
show_json(1, array('goods' => $goods, 'pagesize' => $args['pagesize']));
}
}
}
$this->setHeader();
include $this->template('shop/index');
示例15: intval
if ($operation == 'comment') {
$goodsid = intval($_GPC['goodsid']);
$pindex = max(1, intval($_GPC['page']));
$psize = 5;
$condition = ' and uniacid = :uniacid and goodsid=:goodsid and deleted=0';
$params = array(':uniacid' => $_W['uniacid'], ':goodsid' => $goodsid);
$sql = 'SELECT id,nickname,headimgurl,level,content,createtime, images,append_images,append_content,reply_images,reply_content,append_reply_images,append_reply_content ' . ' FROM ' . tablename('ewei_shop_order_comment') . ' where 1 ' . $condition . ' ORDER BY `id` DESC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize;
$list = pdo_fetchall($sql, $params);
foreach ($list as &$row) {
$row['headimgurl'] = tomedia($row['headimgurl']);
$row['createtime'] = date('Y-m-d H:i', $row['createtime']);
$images = unserialize($row['images']);
$row['images'] = is_array($images) ? set_medias($images) : array();
$append_images = unserialize($row['append_images']);
$row['append_images'] = is_array($append_images) ? set_medias($append_images) : array();
$reply_images = unserialize($row['reply_images']);
$row['reply_images'] = is_array($reply_images) ? set_medias($reply_images) : array();
$append_reply_images = unserialize($row['append_reply_images']);
$row['append_reply_images'] = is_array($append_reply_images) ? set_medias($append_reply_images) : array();
}
unset($row);
show_json(1, array('list' => $list, 'pagesize' => $psize));
} else {
if ($operation == 'recommand') {
$goods = m('goods')->getList(array('pagesize' => 4, 'isrecommand' => true, 'random' => true));
show_json(1, array('list' => $goods));
}
}
}
}
}