From 3961ee521032c4103d3bd5e2800ca4f44825f23e Mon Sep 17 00:00:00 2001 From: devil_gong Date: Wed, 14 Nov 2018 17:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/View/Default/Article/Index.html | 2 +- .../Service/OrderService.class.php | 52 ++++++++++++++++++ service/Public/Common/Css/Common.css | 13 +++++ .../Public/Common/Images/am-icon-alipay.png | Bin 0 -> 2181 bytes service/Public/Home/Default/Css/Common.css | 6 +- 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 service/Public/Common/Images/am-icon-alipay.png 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 0000000000000000000000000000000000000000..f1f7852f0700df0e6d72fb94704aeb1b1992730e GIT binary patch literal 2181 zcmV;02zvL4P)?kNMICqBp-@V^+-n@A;cV@n?Rmw@4Chy&Q&OLMPJXFfD`Bzylfl9$1#aGAZVjdu;|&d$3*x>jCQn zGYw46;3eQE8C;#h_krgJrTL%~-XMZgfRFj>xx~P^3H%iJM}xzz8o@5W-oU;F*3979 z48EAcIlzA!@G4!}RpHfRn4iI?ffQI|;j1`{cBLqSJq;WW?3}?P!0{HY>B6{+!aGH9 z3GO<6)57QV7P}m#V(*L?z5#5V!F3is4m{IFRvU#)3@2xBGVllM-t3)igg4yN>%nmb zz6?BPVHWVShCCX_;a&t68km#8^%gz?{H>|bj_YSca22p7u#flX!7Q6tIF8^l1N#7H zB=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cc(TUu&izX7#Uo7|Ssu_Xh0B@Sf`rY08dGc`Rp$-oy>saQ8(sp@Cglpjn})R4_@L%0Re1RE;Zsrv ztgrC#;o_H`7CS&)jj@qx#gF|;=|ATN#5F8FsW2d}KMR;{V9Ni)fOy#zYx5@n>Qr27 z9a!IGLT_MUsrB3O8(-0XmLox(2zb73u89mF<^00000NkvXX Hu0mjf$G8#y literal 0 HcmV?d00001 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;}