提交 3961ee52 编写于 作者: D devil_gong

优化

上级 04c0ecf2
......@@ -27,7 +27,7 @@
<div class="am-article">{{$article.content}}</div>
</div>
<!-- 侧内容 -->
<!-- 侧内容 -->
<div class="am-u-md-2 am-u-md-pull-10 article-sidebar">
<div class="am-offcanvas" id="article-nav-sidebar">
<div class="am-offcanvas-bar am-offcanvas-bar-overlay">
......
......@@ -853,6 +853,15 @@ class OrderService
return DataReturn($ret['msg'], -10);
}
// 订单商品销量增加
$ret = self::GoodsSalesCountInc(['order_id'=>$order['id']]);
if($ret['status'] != 0)
{
// 事务回滚
$m->rollback();
return DataReturn($ret['msg'], -10);
}
// 用户消息
MessageService::MessageAdd($order['user_id'], '订单收货', '订单收货成功', 1, $order['id']);
......@@ -1301,5 +1310,48 @@ class OrderService
return DataReturn('没有需要操作的数据', 0);
}
/**
* 订单商品销量添加
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-14
* @desc description
* @param [array] $params [输入参数]
*/
public static function GoodsSalesCountInc($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'order_id',
'error_msg' => '订单id有误',
]
];
$ret = params_checked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 获取订单商品
$order_detail = M('OrderDetail')->field('goods_id,buy_number')->where(['order_id'=>$params['order_id']])->select();
if(!empty($order_detail))
{
$goods_m = M('Goods');
foreach($order_detail as $v)
{
if(!$goods_m->where(['id'=>$v['goods_id']])->setInc('sales_count', $v['buy_number']))
{
return DataReturn('订单商品销量增加失败['.$params['order_id'].'-'.$v['goods_id'].']', -10);
}
}
return DataReturn('操作成功', 0);
} else {
return DataReturn('订单有误,没有找到相关商品', -100);
}
}
}
?>
\ No newline at end of file
......@@ -158,4 +158,17 @@ button.colorpicker-submit:active {
}
button.colorpicker-submit img {
margin-right: 10px;
}
/**
* 自定义icon
*/
.am-icon-alipay {
background-image: url('../Images/am-icon-alipay.png');
background-repeat:no-repeat;
background-size:100% 100%;
-moz-background-size:100% 100%;
width: 15px;
height: 15px;
vertical-align: middle;
}
\ No newline at end of file
......@@ -83,9 +83,9 @@ color: #555555;background:none;border-color:transparent;cursor: default;}
/*搜索框*/
.search-bar{height:36px; width: calc(100% - 103px); display: -webkit-inline-box;}
.search-bar form{border:2px solid #d2364c; width:100%;}
.search-bar input{height:32px;width:78%;outline:none; font-size:12px; border:none}
.search-bar input{height:32px;width:72%;outline:none; font-size:12px; border:none}
#search-input { padding-left: 8px; }
#ai-topsearch { width:20%;height:32px;border:none;float:right;background: #d2364c none repeat scroll 0% 0%;
#ai-topsearch { width:27%;height:32px;border:none;float:right;background: #d2364c none repeat scroll 0% 0%;
color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px; }
.search-hot-keywords { margin-top: 5px; height: 16px; overflow: hidden; display: none; }
.search-hot-keywords li { float: left; }
......@@ -137,7 +137,7 @@ color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px; }
.classified{display:none;}
.mobile-navigation{display:none;}
.nav-search{ position:relative;top:0px;z-index:0;margin-bottom: 5px;margin-top: 5px;}
#ai-topsearch{ font-size:14px;height: 36px;line-height: 22px; font-weight: 500; }
#ai-topsearch{ font-size:14px;height: 36px;line-height: 22px; font-weight: 500; width: 20%; }
/*底部*/
.am-footer {text-align:center; display:block;position: relative;margin: 0px auto; padding: 7px 0px 9px; margin-top:20px;}
.am-footer .footer-bd p, .footer .footer-hd p {margin-bottom: 8px;line-height: 27px;border-bottom: 1px solid #DDD; text-align:left;}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册