|
@@ -83,12 +83,22 @@ class Index extends Api
|
|
|
public function runrecord()
|
|
|
{
|
|
|
$nowtime = time();
|
|
|
- $spacetime = 60 * 60;
|
|
|
+ $spacetime = 60 * 90;
|
|
|
+
|
|
|
+ $minTime = $nowtime - $spacetime;
|
|
|
+// 1711172121
|
|
|
+// 1711166775
|
|
|
+ $redis = new \Redis();
|
|
|
+ $redis->connect('127.0.0.1','6379');
|
|
|
+ $redis->zRemRangeByScore("live", 0, $minTime);
|
|
|
+ $uid = $redis->zRangeByScore("live", $minTime, $nowtime);
|
|
|
$returndata = '';
|
|
|
$userdata = db('admin')->field("id")
|
|
|
+ ->whereIn('id', $uid)
|
|
|
// ->where(['livetime' => ['gt', $nowtime - $spacetime]])
|
|
|
->where(['incomeendtime' => ['gt', $nowtime]])
|
|
|
->select();
|
|
|
+
|
|
|
Db::startTrans();
|
|
|
if (!$userdata) {
|
|
|
$returndata = 'no data';
|