diff --git a/service/Application/Home/View/Default/Article/Index.html b/service/Application/Home/View/Default/Article/Index.html index 72e03b3e5..855ca24bd 100755 --- a/service/Application/Home/View/Default/Article/Index.html +++ b/service/Application/Home/View/Default/Article/Index.html @@ -27,7 +27,7 @@
{{$article.content}}
- +
diff --git a/service/Application/Service/OrderService.class.php b/service/Application/Service/OrderService.class.php index 00eb9c1cd..e0f2546fd 100755 --- a/service/Application/Service/OrderService.class.php +++ b/service/Application/Service/OrderService.class.php @@ -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 diff --git a/service/Public/Common/Css/Common.css b/service/Public/Common/Css/Common.css index a550040ef..bcc7f94ad 100755 --- a/service/Public/Common/Css/Common.css +++ b/service/Public/Common/Css/Common.css @@ -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 diff --git a/service/Public/Common/Images/am-icon-alipay.png b/service/Public/Common/Images/am-icon-alipay.png new file mode 100644 index 000000000..f1f7852f0 Binary files /dev/null and b/service/Public/Common/Images/am-icon-alipay.png differ diff --git a/service/Public/Home/Default/Css/Common.css b/service/Public/Home/Default/Css/Common.css index 8de513b7d..54625dd80 100755 --- a/service/Public/Home/Default/Css/Common.css +++ b/service/Public/Home/Default/Css/Common.css @@ -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;}