Merge remote-tracking branch 'origin/master'

This commit is contained in:
Jerry Yan 2019-11-01 19:43:50 +08:00
commit 5a840e6224
4 changed files with 11 additions and 15 deletions

Binary file not shown.

View File

@ -1,8 +1,8 @@
<?php
$data['version'] = 16;
$data['ios_must_update'] = 0; //是否强制更新,0不强制,1强制
$data['ios_must_update'] = 1; //是否强制更新,0不强制,1强制
$data['must_update'] = 1; //是否强制更新,0不强制,1强制
$data['apk_version'] = '2.2.7';
$data['apk_version'] = '2.3.1';
$data['apk_down_url'] = 'http://www.zgqlg.com.cn/H5B854518.wgt';
//$data['ios_version'] = '1.0.0';
$data['ios_appid'] = '1355322179';

View File

@ -229,7 +229,6 @@ class Users extends Base{
$m = Model('common/Table');
$m->setTable('user_vouchers_summary');
$data = $m->getInfo(['userId'=>$userId],'expectedProductNum,expectedCouponsNum,alreadyProductNum,alreadyCouponsNum');
$data = $m->getInfo(['userId'=>$userId],'expectedProductNum,expectedCouponsNum,alreadyProductNum,alreadyCouponsNum');
$m->setTable('shops');
$shopIds = $m->getColumn(['status'=>1,'userId'=>$userId],'shopId');
if($shopIds){

View File

@ -21,12 +21,12 @@ class UserVouchers extends Base{
//应释放总额
$toPaySum = $payFast + $paySlow;
Db::startTrans();
try{
try{
$m = Model('common/Table');
$m->setTable('user_vouchers_summary');
$m->setTable('user_vouchers_summary');
if(1 == date('j')){
//每月损耗
$monthScale = round((100-dataConf('couponsNextMonthInitSacle'))*0.01,2);
$monthScale = round((100-dataConf('couponsNextMonthInitSacle'))*0.01,2);
$giveList = $m->getList([],'id, userId, expectedProductNum, expectedCouponsNum');
foreach ($giveList as &$g) {
if($g['expectedProductNum'] > 0){
@ -38,7 +38,7 @@ class UserVouchers extends Base{
$this->insertVouchersNotice($g['userId'],0,0,$decNum,$desc='预获优惠券月耗损',0,1);
}
}
}
}
$where['isDisabled'] = 0;
//总预获产品券
$allPreProduct = $m->getSum($where,'expectedProductNum');
@ -128,7 +128,7 @@ class UserVouchers extends Base{
$data['isGive'] = 1;
$data['giveDate'] = $time;
$data['giveDay'] = $v['giveDay'] + 1;
$m->updateInfo(['id'=>$v['id']],$data);
Db::name('user_vouchers_summary')->where(['id'=>$v['id']])->update($data);
}
Db::commit();
Db::startTrans();
@ -136,18 +136,16 @@ class UserVouchers extends Base{
// A、当“助购预获”值为负数时每天0.1%耗损在“预获产品券”值扣减。
// B、当“预获产品券”值为负数时每天0.1%耗损在“预获优惠券”值扣减。
// C、当“助购预获”值和“预获产品券”值同为负数时每天0.1%耗损在“预获优惠券”值同时扣减。
$vm = Model('common/Table');
$vm->setTable('user_vouchers_summary');
$data = $vm->whereOr(["helpSaleNum"=>["lt", 0]])->whereOr(["expectedProductNum"=>["lt", 0]])->select();
$data = Db::name('user_vouchers_summary')->whereOr(["helpSaleNum"=>["lt", 0]])->whereOr(["expectedProductNum"=>["lt", 0]])->select();
foreach ($data as $_each){
if($_each["expectedProductNum"]<0){
$count = (float)$_each["expectedProductNum"];
if($_each["helpSaleNum"] < 0)$count+=(float)$_each["helpSaleNum"];
$this->insertVouchersNotice($_each["userId"], 0, 0, $count*((float)dataConf("deductionRateWhennegPreCoupons")/100),
model('common/UserVouchers')->insertVouchersNotice($_each["userId"], 0, 0, $count*((float)dataConf("deductionRateWhennegPreCoupons")/100),
"预获产品券为负,每天耗损预获优惠券", 0);
}else{
$count = (float)$_each["helpSaleNum"];
$this->insertVouchersNotice($_each["userId"], 0, $count*((float)dataConf("deductionRateWhennegPreCoupons")/100),
model('common/UserVouchers')->insertVouchersNotice($_each["userId"], 0, $count*((float)dataConf("deductionRateWhennegPreCoupons")/100),
0, "助购预获为负,每天耗损预获产品券", 0);
}
}
@ -177,8 +175,7 @@ class UserVouchers extends Base{
$m->insertInfo(['targetType'=>0,'targetId'=>$userId,'dataSrc'=>1,'money'=>$alreadyProductNum,'moneyName'=>1,'remark'=>$desc,'moneyType'=>$isAdd,'payType'=>'qlgpay','createTime'=>date('Y/m/d H:i:s')]);
}
if($alreadyCouponsNum>0){
$m->insertInfo(['targetType'=>0,'targetId'=>$userId,'dataSrc'=>1,'money'=>$alreadyProductNum,'moneyName'=>2,'remark'=>$desc,'moneyType'=>$isAdd,'payType'=>'qlgpay','createTime'=>date('Y/m/d H:i:s')]);
$m->insertInfo(['targetType'=>0,'targetId'=>$userId,'dataSrc'=>1,'money'=>$alreadyCouponsNum,'moneyName'=>2,'remark'=>$desc,'moneyType'=>$isAdd,'payType'=>'qlgpay','createTime'=>date('Y/m/d H:i:s')]);
}
//插入或更新详细表
$m->setTable('users');