2 İşlemeler 649d8e3a6f ... f8d7d28217

Yazar SHA1 Mesaj Tarih
  fxq f8d7d28217 Merge remote-tracking branch 'origin/master' 9 ay önce
  fxq 41b81aeece Fixed 10分钟到余额方法的金额方法 9 ay önce
1 değiştirilmiş dosya ile 3 ekleme ve 20 silme
  1. 3 20
      application/api/controller/Index.php

+ 3 - 20
application/api/controller/Index.php

@@ -57,15 +57,13 @@ class Index extends Api
             $upincome =$moenylog= [];
             foreach ($admindata as $k => $vl) {
                 if (isset($temp[$vl['id']])) {
-                    $upincome[] = ['id' => $vl['id'], 'money' => $vl['money'] + $temp[$vl['id']]];
+                    db("admin")->where('id', $vl['id'])->setInc("money",$temp[$vl['id']]);
                     $moenylog[]=['user_id'=>$vl['id'],'money' =>$temp[$vl['id']],'before' => $vl['money'], 'after' => $vl['money'] + $temp[$vl['id']], 'memo' => 'upincome'];
-
-
                 }
             }
             if ($upincome) {
                 $returndata = '123';
-                $this->adminModel->saveAll($upincome);
+//                $this->adminModel->saveAll($upincome);
                 $this->moneyLogModel->saveAll($moenylog);
                 $this->recordModel->where("id", "<=", $maxId)->where(['status' => 0])->update(['status' => 1]);
             }
@@ -109,21 +107,7 @@ class Index extends Api
                 $savedata = $userlinkdata = [];
                 foreach ($userlink as $key => $val) {
 
-                    $unit = 1;
-                    for($i=1;; $i++) {
-                        $unit = bcpow(10, $i, 10);
-                        $tmp = bcmul($val['minincome'], $unit, 10);
-                        if (floor($tmp) < $tmp ) {
-                            continue;
-                        }
-                        break;
-
-//                        if (bccomp("1", bcmul($val['minincome'].'', $unit, 10), 10) !== 1) {
-//                            break;
-//                        }
-                    }
-
-
+                    $unit = bcpow(10, 10);
 //                    $income = mt_rand( * $unit, $val['maxincome'] * $unit) / $unit;
                     $income = bcdiv(mt_rand(bcmul($val['minincome'], $unit, 10), bcmul($val['maxincome'], $unit, 10)), $unit, 10);
                     $savedata[] = ['income' => $income,
@@ -135,7 +119,6 @@ class Index extends Api
                     $userlinkdata[] = ['id' => $val['userlinkid'], 'income' => $val['income'] + $income];
 
                 }
-
                 $this->userlinkModel->saveAll($userlinkdata);
                 $this->recordModel->saveAll($savedata);
                 $returndata = 'insert ' . count($savedata) . ' record';