From 18ffc37a4db91324effe2ccd46a18b038a28f4d9 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 1 Nov 2019 19:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E4=BA=86=E7=8B=97=E5=BF=98=E8=AE=B0?= =?UTF-8?q?=E4=B9=98=E4=BB=A5=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/common/model/Orders.php | 3 +-- hyhproject/common/model/Settlements.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hyhproject/common/model/Orders.php b/hyhproject/common/model/Orders.php index 4621ddd..498b214 100755 --- a/hyhproject/common/model/Orders.php +++ b/hyhproject/common/model/Orders.php @@ -1498,8 +1498,7 @@ class Orders extends Base{ elseif (3 == $order['goodsType']){//助购吧购物 // 计算 SUM(商品*优惠率) 的值 $calBaseNum = Db::table("__ORDERS__ o")->join("__ORDER_GOODS__ g", "g.orderId=o.orderId", 'inner') - ->where(['o.userId'=>$userId,'o.orderId'=>$orderId]) - ->sum('g.goodsPrice*g.discountRate*0.01'); + ->where(['o.orderId'=>$orderId])->sum('g.goodsPrice*g.goodsNum*g.discountRate*0.01'); // foreach ($orderGoods as $orderGood) { // // 在不考虑数据库变更的情况下,这两个值都是存储的数字类型,所以不做特殊处理 // $calBaseNum += (float)$orderGood['goodsPrice'] * (float)$orderGood['discountRate'] / 100; diff --git a/hyhproject/common/model/Settlements.php b/hyhproject/common/model/Settlements.php index c0ee7d9..75938c6 100755 --- a/hyhproject/common/model/Settlements.php +++ b/hyhproject/common/model/Settlements.php @@ -64,7 +64,7 @@ class Settlements extends Base $sellerPreProductNum = round($discountMoney * (dataConf('sellerPreProductInProductScale')*0.01),2);//1 $sellerPreCoupousNum = round($discountMoney * (dataConf('sellerPreCoupousInSaleScale')*0.01),2);//2 $calBaseNum = Db::table("__ORDERS__ o")->join("__ORDER_GOODS__ g", "g.orderId=o.orderId", 'inner') - ->where(['o.orderId'=>$orderId])->sum('g.goodsPrice*g.discountRate*0.01'); + ->where(['o.orderId'=>$orderId])->sum('g.goodsPrice*g.goodsNum*g.discountRate*0.01'); if($sellerPreProductNum >= 0.01 || $sellerPreCoupousNum>=0.01){ if(3 != $order->goodsType){ // step 3 平台送商户:10000×0.4=4000“预获产品券” @@ -82,7 +82,7 @@ class Settlements extends Base if($uUserId == null || $uUserId == 0){$uUserId = 1;} $data = Db::query('SELECT count(`goodsMoney`) as `total` FROM `hyh_orders` WHERE DATE_FORMAT(`createTime`,"%Y%m%d")=DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 day),"%Y%m%d") and `userId`="'.$uUserId.'"'); // 因为count一定会有数据所以不判断了 - if($data[0]["total"]<=dataConf("refPreProductYdGTMoney")){ + if((float)$data[0]["total"]<=(float)dataConf("refPreProductYdGTMoney")){ Model('common/UserVouchers')->insertVouchersNotice($uUserId, $orderId,$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100)*((float)dataConf("refPreProductNoInSaleScale")/100), 0,'交易订单【'.$order['orderNo'].'】推荐商户所得',1); }else{