本文整理汇总了PHP中get_good_price函数的典型用法代码示例。如果您正苦于以下问题:PHP get_good_price函数的具体用法?PHP get_good_price怎么用?PHP get_good_price使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_good_price函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_group_price
function get_group_price($unionid)
{
$unionid = explode('、', $unionid);
$total = "";
foreach ($unionid as $val) {
$id = $val;
$total += get_good_price($id);
}
return $total;
}
开发者ID:WineShop,项目名称:wine,代码行数:10,代码来源:function.php
示例2: getPriceByuid
public function getPriceByuid()
{
$user = D("member");
$uid = $user->uid();
//数量为0,价钱为0
if ($this->getCnt() == 0) {
return 0;
}
$price = 0.0;
$data = M("shopcart")->where("uid='{$uid}'")->select();
foreach ($data as $k => $val) {
$id = $val['goodid'];
$price = get_good_price($id);
$total += $val['num'] * $price;
}
return sprintf("%01.2f", $total);
}
开发者ID:norain2050,项目名称:yershop,代码行数:17,代码来源:ShopcartModel.class.php
示例3: getPriceByuid
public function getPriceByuid()
{
$user = D("member");
$uid = $user->uid();
$map["uid"] = $uid;
//数量为0,价钱为0
if ($this->getCnt() == 0) {
return 0;
} else {
$total = 0.0;
$data = $this->where($map)->select();
foreach ($data as $k => $val) {
$id = $val['goodid'];
$price = get_good_price($id);
$total += $val['num'] * $price;
}
}
return sprintf("%01.2f", $total);
}
开发者ID:stonegithubs,项目名称:yershop,代码行数:19,代码来源:ShopcartModel.class.php
示例4: cancel
public function cancel()
{
$this->meta_title = '取消订单';
/* 左侧菜单 */
$menu = R('index/menulist');
$this->assign('categoryq', $menu);
/* 购物车调用*/
$cart = R("shopcart/usercart");
$this->assign('usercart', $cart);
if (!session('user_auth')) {
$usercart = $_SESSION['cart'];
$this->assign('usercart', $usercart);
}
/* 底部分类调用*/
$menulist = R('Service/AllMenu');
$this->assign('footermenu', $menulist);
/* 热词调用*/
$hotsearch = R("Index/getHotsearch");
$this->assign('hotsearch', $hotsearch);
if (IS_POST) {
$id = I('post.id');
//获取orderid
$order = M("order");
$status = $order->where("orderid='{$id}'")->getField("status");
$num = $order->where("orderid='{$id}'")->getField("ispay");
$shopid = $order->where("orderid='{$id}'")->getField("id");
$data = $order->where("id='{$shopid}'")->select();
foreach ($data as $k => $val) {
$goodid = $val['goodid'];
$price = get_good_price($goodid);
/*取消的商品总额*/
$cash += $val['num'] * $price;
/*退货中的商品件数*/
$num += $val['num'];
/*退货中的商品种类数*/
$count += 1;
}
//订单已提交或未支付直接取消
if ($num == -1 && $status == 1 || $num == 1 && $status == -1) {
//设置订单取消
//保存数据到取消表中后台调用
$cancel = D("cancel");
$cancel->create();
$cancel->create_time = NOW_TIME;
$cancel->status = 3;
$cancel->orderid = $id;
$cancel->cash = $cash;
//取消的金额
$cancel->num = $num;
//取消的数量
$cancel->count = $count;
//取消的种类
$cancel->info = "自助取消";
$cancel->add();
//设置订单为订单已取消
$data = array('status' => '6', 'backinfo' => '订单已关闭');
//更新订单列表订单状态为已取消,清空取消订单操作
if ($order->where("orderid='{$id}'")->setField($data)) {
$this->success('申请成功,订单已取消', U("center/index"));
} else {
$this->error('申请失败,请重试');
}
} else {
$cancel = D("cancel");
$cancel->create();
$cancel->time = NOW_TIME;
$cancel->status = 1;
$cancel->orderid = $id;
$cancel->cash = $cash;
//取消的金额
$cancel->num = $num;
//取消的数量
$cancel->count = $count;
//取消的种类
$cancel->add();
$data = array('status' => '4');
//设置订单状态为已提交,发货等状态不变
if ($order->where("orderid='{$id}'")->setField($data)) {
$this->success('申请成功', U("center/allorder"));
} else {
$this->error('申请失败,请重试');
}
}
} else {
$id = I('get.id');
//获取orderid
$msg = "申请取消订单:";
$order = M("order");
$detail = $order->where("orderid='{$id}'")->select();
$num = $order->where("orderid='{$id}'")->getField("status");
if ($num == "1") {
$paynum = $order->where("orderid='{$id}'")->getField("ispay");
if ($paynum == "1") {
$info = "当前订单状态为未完成支付";
}
if (!$paynum) {
$info = "当前订单已提交等待发货中";
}
}
if ($num == "2") {
//.........这里部分代码省略.........
开发者ID:FortuneZhang,项目名称:yershop,代码行数:101,代码来源:OrderController.class.php
示例5: index
public function index()
{
if (!is_login()) {
$this->error("您还没有登陆", U("User/login"));
}
$this->meta_title = '取消订单';
if (IS_POST) {
$id = I('post.id', '', 'strip_tags');
//获取orderid
$id = safe_replace($id);
//过滤
$order = M("order");
$status = $order->where("orderid='{$id}'")->getField("status");
$num = $order->where("orderid='{$id}'")->getField("ispay");
$shopid = $order->where("orderid='{$id}'")->getField("id");
$data = $order->where("id='{$shopid}'")->select();
foreach ($data as $k => $val) {
$goodid = $val['goodid'];
$price = get_good_price($goodid);
/*取消的商品总额*/
$cash += $val['num'] * $price;
/*退货中的商品件数*/
$num += $val['num'];
/*退货中的商品种类数*/
$count += 1;
}
//订单已提交或未支付直接取消
if ($num == -1 && $status == 1 || $num == 1 && $status == -1) {
//设置订单取消
//保存数据到取消表中后台调用
$cancel = D("cancel");
$cancel->create();
$cancel->create_time = NOW_TIME;
$cancel->status = 3;
$cancel->orderid = $id;
$cancel->cash = $cash;
//取消的金额
$cancel->num = $num;
//取消的数量
$cancel->count = $count;
//取消的种类
$cancel->info = "自助取消";
$cancel->add();
addUserLog('取消订单', $uid);
//设置订单为订单已取消
$data = array('status' => '6', 'backinfo' => '订单已关闭');
//更新订单列表订单状态为已取消,清空取消订单操作
if ($order->where("orderid='{$id}'")->setField($data)) {
$this->success('申请成功,订单已取消', U("center/index"));
} else {
$this->error('申请失败,请重试');
}
} else {
$cancel = D("cancel");
$cancel->create();
$cancel->time = NOW_TIME;
$cancel->status = 1;
$cancel->orderid = $id;
$cancel->cash = $cash;
//取消的金额
$cancel->num = $num;
//取消的数量
$cancel->count = $count;
//取消的种类
$cancel->add();
addUserLog('申请取消订单', $uid);
$data = array('status' => '4');
//设置订单状态为已提交,发货等状态不变
if ($order->where("orderid='{$id}'")->setField($data)) {
$this->success('申请成功', U("center/allorder"));
} else {
$this->error('申请失败,请重试');
}
}
} else {
$id = I('get.id', '', 'strip_tags');
//获取orderid
$msg = "申请取消订单:";
$id = safe_replace($id);
//过滤
$order = M("order");
$detail = $order->where("orderid='{$id}'")->select();
$num = $order->where("orderid='{$id}'")->getField("status");
if ($num == "1") {
$paynum = $order->where("orderid='{$id}'")->getField("ispay");
if ($paynum == "1") {
$info = "当前订单状态为未完成支付";
}
if (!$paynum) {
$info = "当前订单已提交等待发货中";
}
}
if ($num == "2") {
$info = "当前提交的订单已发货,需审核通过后取消";
}
$list = M("shoplist");
foreach ($detail as $n => $val) {
$detail[$n]['id'] = $list->where('orderid=\'' . $val['id'] . '\'')->select();
}
$this->assign('info', $info);
//.........这里部分代码省略.........
开发者ID:gitchenze,项目名称:soloshop,代码行数:101,代码来源:CancelController.class.php
示例6: Addgood
public function Addgood($a, $b)
{
$Tuanid = $a;
$good = $b;
$array = explode(',', $good);
$User = M("Tuanid");
if ($User->where("Tuanpid='{$Tuanid}'")->select()) {
$User->where("Tuanpid='{$Tuanid}'")->delete();
//商品列表如果存在则删除,重新循环遍历
for ($i = 0; $i < count($array); $i++) {
$goodid = $array[$i];
$data["goodid"] = $goodid;
$data["price"] = get_good_tuanprice($goodid);
$data["view"] = get_good_view($goodid);
$data["salenumber"] = get_sales($goodid);
$data["tuanpid"] = $Tuanid;
$data["create_time"] = time();
// 设置用户的创建时间
$User->add($data);
}
} else {
//商品列表不存在,遍历添加
for ($i = 0; $i < count($array); $i++) {
$goodid = $array[$i];
$data["goodid"] = $goodid;
$data["Tuanpid"] = $Tuanid;
$data["price"] = get_good_price($goodid);
$data["view"] = get_good_view($goodid);
$data["salenumber"] = get_sales($goodid);
$data["create_time"] = time();
// 设置用户的创建时间
$User->add($data);
}
}
}
开发者ID:FortuneZhang,项目名称:yershop,代码行数:35,代码来源:TuanController.class.php
示例7: U
</a>
</div>
</div>
<div class="name"><a href="<?php
echo U('Article/detail?id=' . $article['id']);
?>
" benlai-source="1" benlai-location="13-1" target="_blank" title="<?php
echo $article["title"];
?>
"><?php
echo get_good_shorttitle($article["id"]);
?>
</a></div>
<div class="price">
<font>¥</font><span><?php
echo get_good_price($article["id"]);
?>
</span>
<span style="color: #999999; font-size: 12px; font-weight: 400; margin-left: 3px; text-decoration: line-through"><?php
echo get_good_yprice($article["id"]);
?>
</span>
</div>
</li><?php
}
}
} else {
echo "";
}
?>
开发者ID:norain2050,项目名称:yershop,代码行数:30,代码来源:769e70f2e46f34ceb60619bbda5e4691.php
示例8: get_discount_Byid
function get_discount_Byid($id)
{
$groupbuying = M("document_limitbuying");
$map['id'] = $id;
$info = $groupbuying->where($map)->find();
$price = get_good_price($id);
$discount = $price * 10 / $info['market_price'];
return sprintf("%1\$.1f", $discount);
}
开发者ID:kevins1022,项目名称:tpshop,代码行数:9,代码来源:function.php
示例9: getPricetotal
public function getPricetotal($id)
{
$data = M("shoplist")->where("orderid='{$id}'")->select();
foreach ($data as $k => $val) {
$goodid = $val['goodid'];
$price = get_good_price($goodid);
$total += $val['num'] * $price;
}
return sprintf("%01.2f", $total);
}
开发者ID:norain2050,项目名称:yershop,代码行数:10,代码来源:ShopcartController.class.php
示例10: month
public function month()
{
$month = date('Y年m月', NOW_TIME);
/*格式时间戳为 201410*/
$this->assign('month', $month);
//date('w',$time); 取到的是星期几 0-6
//date('W',$time); 取到的是本年度的第几周 1-53
// php获取本月起始时间戳和结束时间戳
$beginThismonth = mktime(0, 0, 0, date('m'), 1, date('Y'));
$endThismonth = mktime(23, 59, 59, date('m'), date('t'), date('Y'));
$this->meta_title = '管理首页';
$title = "本月数据统计 ";
$q = date('YmdHis', $beginThismonth);
/*本月一零点格式时间戳为20141020000000*/
$b = date('YmdHis', $endThismonth);
/*本月末格式时间戳为201410270000000*/
/*本月销量统计*/
$order = M("order")->where("total!=''")->select();
foreach ($order as $n => $val) {
$time = $val['create_time'];
$a = date('YmdHis', $time);
/*格式时间戳为 20141020000*/
if ($b > $a && $a > $q) {
//本月
/*商品销售额*/
$salesmoney += $val['total'];
/*运费*/
$trans += $val['shipprice'];
/*总销售额*/
$total += $val['pricetotal'];
$id = $val['id'];
$list = M("shoplist")->where("orderid='{$id}'")->select();
foreach ($list as $k => $vo) {
/*退货中的商品id*/
$goodid = $vo['goodid'];
$price = get_good_price($goodid);
/*销售的商品件数*/
$salenum += $vo['num'];
/*销售的商品种类数*/
$salecount += 1;
}
}
}
$this->assign('salecount', $salecount);
$this->assign('salenum', $salenum);
$this->assign('total', $total);
/**
* 本月退货金额、种类、数量计算
*/
$data = M("backlist")->where("status='1'")->select();
foreach ($data as $n => $val) {
/*格式时间戳为 201410240000*/
$dtime = $val['create_time'];
$d = date('YmdHis', $dtime);
if ($b > $d && $d > $q) {
//当天
/*退货中的商品id*/
$goodid = $val['goodid'];
$price = get_good_price($goodid);
/*退货中的商品总额*/
$back += $val['num'] * $price;
/*退货中的商品件数*/
$backnum += $val['num'];
/*退货中的商品种类数*/
$backcount += 1;
}
}
$this->assign('back', $back);
$this->assign('backcount', $backcount);
$this->assign('backnum', $backnum);
/**
* 本月换货金额、种类、数量计算
*/
$data = M("exchange")->where("status='1'")->select();
foreach ($data as $k => $vo) {
$qtime = $vo['create_time'];
$f = date('YmdHis', $qtime);
if ($b > $f && $f > $q) {
/*换货中的商品总额*/
$goodid = $vo['goodid'];
$price = get_good_price($goodid);
$change += $vo['num'] * $price;
/*换货中的商品件数*/
$changenum += $vo['num'];
/*换货中的商品种类数*/
$changecount += 1;
}
}
$this->assign('change', $change);
$this->assign('changecount', $changecount);
$this->assign('changenum', $changenum);
/**
* 本月申请取消订单金额、种类、数量计算
*/
$cdata = M("cancel")->where("status='1'")->select();
foreach ($cdata as $k => $val) {
/*格式时间戳为 20141024*/
$cantime = $val['create_time'];
$s = date('YmdHis', $cantime);
if ($b > $s && $s > $q) {
//.........这里部分代码省略.........
开发者ID:gitchenze,项目名称:soloshop,代码行数:101,代码来源:StatisticsController.class.php
示例11: U
<td><A href="<?php
echo U('Home:Article/detail?id=' . $vo['goodid']);
?>
" > <img src="<?php
echo get_cover(get_cover_id($info["goodid"]), 'path');
?>
" width="40" height="40"/><?php
echo get_good_name($info["goodid"]);
?>
</A></td>
<td align="center"> <span class="weight"><?php
echo get_weight($info["goodid"]);
?>
</span>g</td>
<td align="center"><?php
echo get_good_price($info["goodid"]);
?>
</td>
<td align="center"><?php
echo $info["num"];
?>
</td>
</tr>
</tbody></table> <BR/>
<div style="color:red">
<p style="text-align:right;color:red;width:100%">小计:<?php
echo $info["total"];
?>
元 </p>
<p style="text-align:right;color:red;width:100%">申请时间:<?php
开发者ID:norain2050,项目名称:yershop,代码行数:31,代码来源:05d2319e96918e86c7f1b2d2b74e8326.php
示例12: change
public function change()
{
if (IS_POST) {
$id = I('post.id');
//获取id
$num = I('post.num');
//获取num
$change = D("change");
$change->create();
$change->create_time = NOW_TIME;
$change->total = $num * get_good_price(I('post.goodid'));
$change->status = 1;
$change->add();
//更改商品的售后信息
$data['status'] = -4;
$shop = M("shoplist");
if ($shop->where("id='{$id}'")->save($data)) {
$this->success('申请成功');
} else {
$this->error('申请失败,或重复操作');
}
} else {
$id = I('get.id');
//获取id
$msg = "Tips,提交换货单";
$detail = M("shoplist")->find($id);
//获取购物清单
$this->assign('info', $detail);
$this->assign('msg', $msg);
$this->display();
}
}
开发者ID:stonegithubs,项目名称:yershop,代码行数:32,代码来源:OrderController.class.php
示例13: 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
示例14: U
<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"];
?>
</td>
</tr><?php
}
}
} else {
echo "";
}
?>
</tbody></table> <BR/>
开发者ID:norain2050,项目名称:yershop,代码行数:31,代码来源:2cc296570db71fc54a095a0992ddf32e.php
示例15: detail
public function detail()
{
/**
*接收数据并统计
* @return none
*/
$day = I('get.day');
if ($day) {
/***按天数统计 */
$a = date('Ymd', $day);
/*格式时间戳为 20141024*/
$this->meta_title = date('Y年m月d日', $day) . '的数据统计';
$title = date('Y年m月d日', $day) . '的数据统计';
/*销售统计*/
$order = M("order")->where("total!=''")->select();
foreach ($order as $n => $val) {
$time = $val['ptime'];
$b = date('Ymd', $time);
if ($a == $b) {
//当月
/*商品销售额*/
$salesmoney += $val['total'];
/*运费*/
$trans += $val['shipprice'];
/*总销售额*/
$total += $val['pricetotal'];
$id = $val['id'];
$list = M("shoplist")->where("orderid='{$id}'")->select();
foreach ($list as $k => $vo) {
/*退货中的商品id*/
$goodid = $vo['goodid'];
$price = get_good_price($goodid);
/*销售的商品件数*/
$salenum += $vo['num'];
/*销售的商品种类数*/
$salecount += 1;
}
}
}
$this->assign('salecount', $salecount);
$this->assign('salenum', $salenum);
$this->assign('trans', $trans);
$this->assign('salesmoney', $salesmoney);
$this->assign('total', $total);
/**
* 当天退货金额、种类、数量计算
*/
$data = M("backlist")->where("status='1'")->select();
foreach ($data as $k => $val) {
/*格式时间戳为 20141024*/
$time = $val['create_time'];
$d = date('Ymd', $time);
if ($a == $d) {
//当天
/*退货中的商品id*/
$goodid = $val['goodid'];
$price = get_good_price($goodid);
/*退货中的商品总额*/
$back += $val['num'] * $price;
/*退货中的商品件数*/
$backnum += $val['num'];
/*退货中的商品种类数*/
$backcount += 1;
}
}
$this->assign('back', $back);
$this->assign('backcount', $backcount);
$this->assign('backnum', $backnum);
/**
* 当天换货金额、种类、数量计算
*/
$data = M("change")->where("status='1'")->select();
foreach ($data as $k => $val) {
$time = $val['create_time'];
$f = date('Ymd', $time);
if ($a == $f) {
//当天
/*换货中的商品总额*/
$goodid = $val['goodid'];
$price = get_good_price($goodid);
$change += $val['num'] * $price;
/*换货中的商品件数*/
$changenum += $val['num'];
/*换货中的商品种类数*/
$changecount += 1;
}
}
$this->assign('change', $change);
$this->assign('changecount', $changecount);
$this->assign('changenum', $changenum);
/**
* 当天申请取消订单金额、种类、数量计算
*/
$cdata = M("cancel")->where("status='1'")->select();
foreach ($cdata as $k => $val) {
/*格式时间戳为 20141024*/
$stime = $val['create_time'];
$s = date('Ymd', $stime);
if ($a == $s) {
//当天
//.........这里部分代码省略.........
开发者ID:FortuneZhang,项目名称:yershop,代码行数:101,代码来源:ReportController.class.php
示例16: 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
示例17: detailByMonth
public function detailByMonth($month)
{
$m = date('Ym', $month);
/*格式时间戳为 201410*/
$this->meta_title = date('Y年m月', $month) . '的数据统计';
$title = date('Y年m月', $month) . '的数据统计';
/*销售统计*/
$field = 'id,orderid,tag,pricetotal,create_time,status,ispay,total,shipprice';
$order = M("order")->where("total!=''")->field($field)->select();
$salesmoney = $trans = $total = $salenum = $salecount = 0;
foreach ($order as $n => $val) {
$time = $val['create_time'];
$b = date('Ym', $time);
if ($m == $b) {
//
/*商品销售额*/
$salesmoney += $val['total'];
/*运费*/
$trans += $val['shipprice'];
/*总销售额*/
$total += $val['pricetotal'];
$id = $val['id'];
$field = 'id,goodid,num,orderid,uid,status,create_time,price,total,sort,tag,parameters';
$list = M("shoplist")->field($field)->where("orderid='{$id}'")->select();
foreach ($list as $k => $vo) {
/*退货中的商品id*/
$goodid = $vo['goodid'];
$price = $vo['price'];
/*销售的商品件数*/
$salenum += $vo['num'];
/*销售的商品种类数*/
$salecount += 1;
}
}
}
$this->assign('salecount', $salecount);
$this->assign('salenum', $salenum);
$this->assign('trans', $trans);
$this->assign('salesmoney', $salesmoney);
$this->assign('total', $total);
/**
* 当月退货金额、种类、数量计算
*/
$back = $backnum = $backcount = 0;
$field = 'id,goodid,num,tool,toolid,status,create_time,info,total,shopid';
$data = M("backlist")->field($field)->where("status='1'")->select();
foreach ($data as $k => $val) {
/*格式时间戳为 20141024*/
$time = $val['create_time'];
$d = date('Ym', $time);
if ($m == $d) {
//当天
/*退货中的商品id*/
$goodid = $val['goodid'];
$price = get_good_price($goodid);
/*退货中的商品总额*/
$back += $val['num'] * $price;
/*退货中的商品件数*/
$backnum += $val['num'];
/*退货中的商品种类数*/
$backcount += 1;
}
}
$this->assign('back', $back);
$this->assign('backcount', $backcount);
$this->assign('backnum', $backnum);
/**
* 当月换货金额、种类、数量计算
*/
$field = 'id,goodid,num,tool,toolid,uid,status,create_time,info,total,shopid';
$change = $changenum = $changecount = 0;
$data = M("change")->where("status='1'")->field($field)->select();
foreach ($data as $k => $val) {
$time = $val['create_time'];
$f = date('Ym', $time);
if ($m == $f) {
//同月
/*换货中的商品总额*/
$goodid = $val['goodid'];
$price = get_good_price($goodid);
$change += $val['num'] * $price;
/*换货中的商品件数*/
$changenum += $val['num'];
/*换货中的商品种类数*/
$changecount += 1;
}
}
$this->assign('change', $change);
$this->assign('changecount', $changecount);
$this->assign('changenum', $changenum);
/**
* 本周申请取消订单金额、种类、数量计算
*/
$field = 'id,goodid,num,orderid,create_time,shopid,status,cash,count';
$cancel = $cancelnum = $cancelcount = 0;
$cdata = M("cancel")->where("status='1'")->field($field)->select();
foreach ($cdata as $k => $val) {
/*格式时间戳为 20141024*/
$sytime = $val['create_time'];
$sy = date('Ym', $sytime);
//.........这里部分代码省略.........
开发者ID:WineShop,项目名称:wine,代码行数:101,代码来源:ReportController.class.php
示例18: foreach
}
}
} else {
echo "";
}
?>
</ul>
</div>
<div class="salesrank">
<h5><span>最近浏览</span></h5>
<ul><?php
if (is_array($recent)) {
$i = 0;
$__LIST__ = $recent;
if (count($__LIST__) == 0) {
echo "";
} else {
foreach ($__LIST__ as $key => $vo) {
$mod = $i % 2;
++$i;
?>
<li><a class="picture" href="<?php
echo U('Article/detail?id=' . $vo['page']);
?>
"><img src="<?php
echo get_cover(get_cover_id($vo["page"]), 'path');
?>
" ></a>
<a class="title" href="<?php
echo U('Article/detail?id=' . $vo['page']);
开发者ID:a1357479,项目名称:techan,代码行数:31,代码来源:5231e2bbdb7b9edc1f0f29f2bbab2a6e.php
注:本文中的get_good_price函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论