Переглянути джерело

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

- 在系统配置中添加"award_integral_price"字段,用于设置分红积分基准价格
- 添加对分红积分基准价格的验证,确保其值大于 0
- 优化了代码格式,调整了数组元素的缩进
kirin 5 місяців тому
батько
коміт
98923cd533

+ 2 - 0
app/common/repositories/user/AwardIntegralPriceRepository.php

@@ -15,6 +15,7 @@ namespace app\common\repositories\user;
 
 
 use app\common\dao\user\AwardIntegralPriceDao;
+use app\common\model\user\AwardIntegralPrice;
 use app\common\repositories\BaseRepository;
 
 
@@ -43,6 +44,7 @@ class AwardIntegralPriceRepository extends BaseRepository
         if ($info = $this->dao->search(['day' => date('Y-m-d')])->find()) {
             return $info->toArray();
         }
+        @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;

+ 0 - 1
crmeb/listens/AutoSavePriceListen.php

@@ -31,7 +31,6 @@ class AutoSavePriceListen extends TimerService implements ListenerInterface
             $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', AwardIntegralPrice::getLastSql());
             if (!isset($yesterday['basePrice'])) {
                 return;
             }