|
@@ -86,7 +86,7 @@ class Index extends Api
|
|
|
$spacetime = 60 * 60;
|
|
|
$returndata = '';
|
|
|
$userdata = db('admin')->field("id")
|
|
|
-// ->where(['livetime' => ['gt', $nowtime - $spacetime]])
|
|
|
+ ->where(['livetime' => ['gt', $nowtime - $spacetime]])
|
|
|
->where(['incomeendtime' => ['gt', $nowtime]])
|
|
|
->select();
|
|
|
Db::startTrans();
|
|
@@ -122,6 +122,17 @@ class Index extends Api
|
|
|
];
|
|
|
$userlinkdata[] = ['id' => $val['userlinkid'], 'income' => $val['income'] + $income];
|
|
|
|
|
|
+ if ($key != 0 && $key % 100 == 0) {
|
|
|
+ echo $key."\n";
|
|
|
+ $this->userlinkModel->saveAll($userlinkdata);
|
|
|
+ $this->recordModel->saveAll($savedata);
|
|
|
+ $userlinkdata = [];
|
|
|
+ $savedata == [];
|
|
|
+ Db::commit();
|
|
|
+ Db::startTrans();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
$this->userlinkModel->saveAll($userlinkdata);
|
|
|
$this->recordModel->saveAll($savedata);
|