sum写成count的BUG

This commit is contained in:
Jerry Yan 2019-11-01 19:54:17 +08:00
parent 5a840e6224
commit 3bcb66e71f

View File

@ -93,7 +93,7 @@ class Settlements extends Base
// 当消费低于限制值时10000×0.4×0.5×0.2=400“预获产品券”。 // 当消费低于限制值时10000×0.4×0.5×0.2=400“预获产品券”。
$uUserId = UserTrees::getUpperId($order['userId']); $uUserId = UserTrees::getUpperId($order['userId']);
if($uUserId == null || $uUserId == 0){$uUserId = 1;} 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.'"'); $data = Db::query('SELECT sum(`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一定会有数据所以不判断了 // 因为count一定会有数据所以不判断了
if($data[0]["total"]<=dataConf("refPreProductYdGTMoney")){ if($data[0]["total"]<=dataConf("refPreProductYdGTMoney")){
Model('common/UserVouchers')->insertVouchersNotice($uUserId, $orderId,$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100)*((float)dataConf("refPreProductNoInSaleScale")/100), Model('common/UserVouchers')->insertVouchersNotice($uUserId, $orderId,$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100)*((float)dataConf("refPreProductNoInSaleScale")/100),