Просмотр исходного кода

feat(admin): 添加分红积分基准价格设置并进行有效性验证

- 在系统配置中添加"award_integral_price"字段,用于设置分红积分基准价格
- 添加对分红积分基准价格的验证,确保其值大于 0
- 优化了代码格式,调整了数组元素的缩进
kirin 5 месяцев назад
Родитель
Сommit
6b314ceef8

+ 1 - 1
app/common/repositories/user/AwardIntegralPriceRepository.php

@@ -45,7 +45,7 @@ class AwardIntegralPriceRepository extends BaseRepository
         if ($info = $this->dao->search(['day' => $day])->find()) {
             return $info->toArray();
         }
-        @file_put_contents('yesterday.txt', AwardIntegralPrice::getLastSql() . PHP_EOL, FILE_APPEND);
+//        @file_put_contents('yesterday.txt', AwardIntegralPrice::getLastSql() . PHP_EOL, FILE_APPEND);
         $yesterday_price = $this->dao->search(['day' => date('Y-m-d', strtotime('-1 day', strtotime($day)))])->find();
         if ($yesterday_price) {
             $basePrice = $yesterday_price->price;

+ 1 - 1
crmeb/listens/AutoSavePriceListen.php

@@ -30,7 +30,7 @@ class AutoSavePriceListen extends TimerService implements ListenerInterface
             $day = date('Y-m-d', strtotime('-1 day'));
             $service = app()->make(AwardIntegralPriceRepository::class);
             $yesterday = $service->awardIntegralPrice($day);
-            @file_put_contents('yesterday.txt', json_encode($yesterday) . PHP_EOL, FILE_APPEND);
+//            @file_put_contents('yesterday.txt', json_encode($yesterday) . PHP_EOL, FILE_APPEND);
             if (!isset($yesterday['basePrice'])) {
                 return;
             }