本文整理汇总了PHP中get_cover_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_cover_id函数的具体用法?PHP get_cover_id怎么用?PHP get_cover_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_cover_id函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addgood
public function addgood($id)
{
$tag = htmlspecialchars($_POST['tag']);
$num = 1;
$id = htmlspecialchars($_POST['id']);
$price = get_good_price($id);
if (!isset($_SESSION['cart'])) {
$_SESSION['cart'] = array();
}
$item = array();
//如果该商品已存在则直接加其数量
if (isset($_SESSION['cart'][$id])) {
$_SESSION['cart'][$id]['num'] += $num;
$item['id'] = $id;
$item['price'] = $price;
$item['num'] = $_SESSION['cart'][$id]['num'];
$_SESSION['cart'][$id] = $item;
$exsit = "1";
} else {
$item['id'] = $id;
$item['price'] = $price;
$item['num'] = $num;
$_SESSION['cart'][$id] = $item;
$exsit = "0";
}
$data['status'] = 1;
$data['price'] = get_good_price($id);
$coverid = get_cover_id($id);
$data['src'] = get_good_img($coverid);
$data['title'] = get_good_name($id);
//登录用户,处理详情页ajaxt提交的数据保存到数据库
if (is_login()) {
$table = D("shopcart");
$data['goodid'] = $id;
$data['num'] = $num;
$member = D("member");
$uid = $member->uid();
$data['uid'] = $uid;
$pnum = M("shopcart")->where("goodid='{$id}'and uid='{$uid}'")->getField("num");
if ($pnum) {
$exsit = "1";
$data['num'] = $pnum + $num;
$table->where("goodid='{$id}'and uid='{$uid}'")->save($data);
} else {
$data['num'] = $num;
$table->add($data);
$exsit = "0";
}
$data['sql'] = 'sql';
$data['num'] = M("shopcart")->where("goodid='{$id}'and uid='{$uid}'")->getField("num");
$data['msg'] = '添加成功';
$data['exsit'] = $exsit;
$this->ajaxReturn($data);
} else {
$data['exsit'] = $exsit;
$data['num'] = $item['num'];
$data['msg'] = '添加成功';
$this->ajaxReturn($data);
}
}
开发者ID:a1357479,项目名称:techan,代码行数:60,代码来源:ShopcartController.class.php
示例2: foreach
echo "";
} else {
foreach ($__LIST__ as $key => $vo) {
$mod = $i % 2;
++$i;
?>
<tr>
<td align="center"><?php
echo $vo["goodid"];
?>
</td>
<td><A href="<?php
echo U('Home/Article/detail?id=' . $vo['goodid']);
?>
" > <img src="<?php
echo get_cover(get_cover_id($vo["goodid"]), 'path');
?>
" width="40" height="40"/><?php
echo get_good_name($vo["goodid"]);
?>
</A></td>
<td align="center"> <span class="weight"><?php
echo get_weight($vo["goodid"]);
?>
</span>g</td>
<td align="center"><?php
echo get_good_price($vo["goodid"]);
?>
</td>
<td align="center"><?php
echo $vo["num"];
开发者ID:norain2050,项目名称:yershop,代码行数:31,代码来源:2cc296570db71fc54a095a0992ddf32e.php
示例3: addgood
/**
* 添加商品 添加商品 未用到
* param int $id 商品主键
* int $num 购物数量
*/
public function addgood($id)
{
$tag = $_POST['tag'];
$num = 1;
$id = $_POST['id'];
$price = get_good_price($id);
if (!isset($_SESSION['cart'])) {
$_SESSION['cart'] = array();
}
$item = array();
//如果该商品已存在则直接加其数量
if (isset($_SESSION['cart'][$id])) {
$_SESSION['cart'][$id]['num'] += $num;
$item['id'] = $id;
$item['price'] = $price;
$item['num'] = $_SESSION['cart'][$id]['num'];
$_SESSION['cart'][$id] = $item;
$exsit = "1";
} else {
$item['id'] = $id;
$item['price'] = $price;
$item['num'] = $num;
$_SESSION['cart'][$id] = $item;
$exsit = "0";
}
$data['status'] = 1;
$data['price'] = get_good_price($id);
$coverid = get_cover_id($id);
$data['src'] = get_good_img($coverid);
$data['title'] = get_good_name($id);
$data['exsit'] = $exsit;
$data['num'] = $item['num'];
$data['msg'] = '添加成功';
$this->ajaxReturn($data);
}
开发者ID:WineShop,项目名称:wine,代码行数:40,代码来源:ShopcartController.class.php
示例4: C
?>
&pic=<?php
echo C('DOMAIN');
echo get_cover($info["cover_id"], 'path');
?>
" data-item="sina" class="J_vivo_share">
<img alt="新浪微博" src="/b2c/Public/Home/images/icon_sina_weibo.jpg" app="b2c"> </a>
<a title="分享到腾讯微博" target="_blank" href="http://v.t.qq.com/share/share.php?title=<?php
echo $info["title"];
?>
(来自<?php
echo C('SITENAME');
?>
)。&url=<?php
echo C('DOMAIN');
echo U('Article/detail?id=' . $info['id']);
?>
&pic=<?php
echo C('DOMAIN');
echo get_cover($info["cover_id"], 'path');
?>
" data-item="tencent" class="J_vivo_share">
<img alt="腾讯微博" src="/b2c/Public/Home/images/icon_tencent_weibo.jpg" app="b2c"> </a>
<a target="_blank" title="分享到人人网" href="http://widget.renren.com/dialog/share?resourceUrl=<?php
echo C('DOMAIN');
echo U('Article/detail?id=' . $info['id']);
?>
;srcUrl=<?php
echo C('DOMAIN');
?>
&title=<?php
开发者ID:FortuneZhang,项目名称:yershop,代码行数:31,代码来源:5c8e64f9796d3cd3e715f25b5ba7d7a5.php
示例5:
echo get_nav_url($nav["url"]);
?>
" target="<?php
if ($nav["target"] == "1") {
?>
_blank<?php
} else {
?>
_self<?php
}
?>
"><?php
echo $nav["title"];
?>
</a>
</li><?php
}
}
}
} else {
echo "";
}
?>
</ul>
</div>
<!-- /菜单 -->
<!-- 主体 -->
<div class="commom_wrapper">
开发者ID:a1357479,项目名称:techan,代码行数:31,代码来源:5231e2bbdb7b9edc1f0f29f2bbab2a6e.php
注:本文中的get_cover_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论