修改:消费返利商品购买后不立即返利 需要一个月后才开始进行返利
This commit is contained in:
parent
0bd65f2142
commit
179e731baa
|
|
@ -612,7 +612,7 @@ class Privilege extends BaseModel
|
|||
if(empty($rebateInfo)) return;
|
||||
$rebateInfo = $rebateInfo->toArray();
|
||||
// 判断:最大状态是否为1或者2 不是则失效,允许购买
|
||||
if(!in_array($rebateInfo['max_status'],[1,2])) return;
|
||||
if(!in_array($rebateInfo['max_status'],[0,1,2])) return;
|
||||
// 判断:最后结算信息获取 并且判断是否需要复购,需要则返回复购价格
|
||||
$endInfo = Rebate::uniacid()
|
||||
->where('uid', $member->uid)
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ abstract class BaseOrderGoodsPrice extends OrderGoodsPrice
|
|||
if(empty($rebateInfo)) return $this->price;
|
||||
$rebateInfo = $rebateInfo->toArray();
|
||||
// 判断:最大状态是否为1或者2 不是则失效,原价购买
|
||||
if(!in_array($rebateInfo['max_status'],[1,2])) return $this->price;
|
||||
if(!in_array($rebateInfo['max_status'],[0,1,2])) return $this->price;
|
||||
// 判断:最后结算信息获取 并且判断是否需要复购,需要则返回复购价格
|
||||
$endInfo = Rebate::uniacid()
|
||||
->where('uid', $this->orderGoods->uid)
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ class Rebate extends BaseModel{
|
|||
$endKey = max(array_keys($quarterInfo['month_list']));// 最后一个元素的键
|
||||
foreach($quarterInfo['month_list'] as $monthIndex => $monthInfo){
|
||||
// 预计解冻时间 增加
|
||||
$expectThawTimeMonth++;// 第一笔需要一个月后再返 因此需要在计算当前返利时间前增加一个月
|
||||
$currentExpectThawTime = getNextMonthDays($expectThawTime, $expectThawTimeMonth);
|
||||
$expectThawTimeMonth++;
|
||||
// 生成返利信息
|
||||
$currentMonthData = [
|
||||
'uniacid' => $uniacid,
|
||||
|
|
@ -116,10 +116,10 @@ class Rebate extends BaseModel{
|
|||
'updated_at' => time(),
|
||||
];
|
||||
// 判断:第一季度第一个月 并且 (不是最后一个月 或者 本季度不需要复购):立即解冻
|
||||
if($quarterIndex == 1 && $monthIndex == 1 && ($monthIndex != $endKey || (int)$quarterInfo['is_repurchase'] != 1)){
|
||||
$currentMonthData['reality_thaw_time'] = time();
|
||||
$currentMonthData['status'] = 1;
|
||||
}
|
||||
// if($quarterIndex == 1 && $monthIndex == 1 && ($monthIndex != $endKey || (int)$quarterInfo['is_repurchase'] != 1)){
|
||||
// $currentMonthData['reality_thaw_time'] = time();
|
||||
// $currentMonthData['status'] = 1;
|
||||
// }
|
||||
|
||||
$insertData[] = $currentMonthData;
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ class Rebate extends BaseModel{
|
|||
// 添加数据
|
||||
if(count($insertData) > 0) {
|
||||
self::insert($insertData);
|
||||
self::rebateSettlement();
|
||||
// self::rebateSettlement();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue