|
@@ -75,16 +75,17 @@ class AwardIntegralPriceRepository extends BaseRepository
|
|
|
$num = $userService->search(['status' => 1])->sum('award_integral');
|
|
$num = $userService->search(['status' => 1])->sum('award_integral');
|
|
|
$sum_achievement = bcadd((string)$commission, (string)$achievement, 6);
|
|
$sum_achievement = bcadd((string)$commission, (string)$achievement, 6);
|
|
|
$rise = $num > 0 ? bcdiv($sum_achievement, $num, 6) : 0;
|
|
$rise = $num > 0 ? bcdiv($sum_achievement, $num, 6) : 0;
|
|
|
|
|
+ $add_price = 0;
|
|
|
if ($rise >0){
|
|
if ($rise >0){
|
|
|
// 增长值分成25份
|
|
// 增长值分成25份
|
|
|
- $add_price = bcdiv($rise, 25, 6);
|
|
|
|
|
|
|
+ $day_25_rise = bcdiv($rise, 25, 6);
|
|
|
/** @var AwardIntegralPriceDayDao $AwardIntegralPriceDayDao */
|
|
/** @var AwardIntegralPriceDayDao $AwardIntegralPriceDayDao */
|
|
|
$AwardIntegralPriceDayDao = app()->make(AwardIntegralPriceDayDao::class);
|
|
$AwardIntegralPriceDayDao = app()->make(AwardIntegralPriceDayDao::class);
|
|
|
- $AwardIntegralPriceDayDao->create(['day' => strtotime('-25 day'), 'price' => $rise,'add_price'=>$add_price]); //保存今天增长的总价格和每日增长价格
|
|
|
|
|
|
|
+ $AwardIntegralPriceDayDao->create(['day' => strtotime('-25 day'), 'price' => $rise,'add_price'=>$day_25_rise]); //保存今天增长的总价格和每日增长价格
|
|
|
$day_25 =strtotime('-25 day');
|
|
$day_25 =strtotime('-25 day');
|
|
|
- $day_25_rise = $AwardIntegralPriceDayDao->search(['day' => $day])->sum('price');
|
|
|
|
|
|
|
+ $add_price = $AwardIntegralPriceDayDao->search(['day' => $day_25])->sum('price');
|
|
|
}
|
|
}
|
|
|
- $price = bcadd($day_25_rise, $basePrice, 6);
|
|
|
|
|
|
|
+ $price = bcadd($add_price, $basePrice, 6);
|
|
|
|
|
|
|
|
@file_put_contents('quanju4.txt', time()."-正常获取走的到这里吗\r\n",8);
|
|
@file_put_contents('quanju4.txt', time()."-正常获取走的到这里吗\r\n",8);
|
|
|
return compact('basePrice', 'price', 'rise', 'achievement', 'commission', 'num','add_price');
|
|
return compact('basePrice', 'price', 'rise', 'achievement', 'commission', 'num','add_price');
|
|
@@ -93,6 +94,7 @@ class AwardIntegralPriceRepository extends BaseRepository
|
|
|
public function setPrice($day, $price, $commission, $achievement, $num,$add_price)
|
|
public function setPrice($day, $price, $commission, $achievement, $num,$add_price)
|
|
|
{
|
|
{
|
|
|
$add_time = time();
|
|
$add_time = time();
|
|
|
|
|
+ @file_put_contents('quanju4.txt', $add_price."-我add_price呢\r\n",8);
|
|
|
return $this->dao->create(compact('day', 'price', 'commission', 'achievement', 'num', 'add_time','add_price'));
|
|
return $this->dao->create(compact('day', 'price', 'commission', 'achievement', 'num', 'add_time','add_price'));
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|