WIN-2308041133\Administrator 5 months ago
parent
commit
9441e0a187
1 changed files with 6 additions and 2 deletions
  1. 6 2
      app/common/model/user/AwardLake.php

+ 6 - 2
app/common/model/user/AwardLake.php

@@ -70,7 +70,6 @@ class AwardLake extends BaseModel
         }
         $lakes = self::where('send_time', '<', $time)->select();
             @file_put_contents('quanju.txt',$time."-1点的时间戳\r\n",8);
-            @file_put_contents('quanju.txt',json_encode($lakes)."-发放时间小于1点的\r\n",8);
         foreach ($lakes as $lake) {
             $this->sendAward($lake['id']);
         }
@@ -79,6 +78,7 @@ class AwardLake extends BaseModel
 
     public function sendAward($lake_id)
     {
+        try{
         $lake = self::where('id', $lake_id)->find();
         @file_put_contents('quanju.txt',json_encode($lake)."-奖池信息\r\n",8);
         if (!$lake) return true;
@@ -117,7 +117,7 @@ class AwardLake extends BaseModel
         $price = app()->make(AwardIntegralPriceRepository::class)->awardIntegralPrice();  //分红积分价格
         foreach ($users as $user) {
             //todo 添加用户积分  用户分的奖励除以积分价格就是积分数量
-            $integral = bcdiv($every, $price, 2);
+            $integral = bcmul($every, $price, 2);
             $award_integral=User::where('uid', $user['uid'])->value('award_integral');
             $after = bcadd($award_integral, $integral, 2);
             // 创建用户账单仓库实例
@@ -138,5 +138,9 @@ class AwardLake extends BaseModel
         }
         AwardLakeLog::expend($lake['id'], 'send', $real_send, 0, '奖池分红');
         self::where('id', $lake['id'])->update(['send_time' => time()]);
+        }catch (Exception $e){
+            @file_put_contents('quanju.txt',$e->getMessage()."-错误信息\r\n",8);
+            @file_put_contents('quanju.txt',$e->getLine()."-错误位置\r\n",8);
+        }
     }
 }