<?php
namespace app\index\controller;
use think\facade\Db;

/**
 * 数据测试
 */
class Test {

    public function Index() {
        echo '开始数据测试<br>';
        $where = [];
        $where[] = ['data_flag',"=",1];
        $where[] = ['predicted_total',">=",100];

        $time1 = strtotime("2026-07-20 00:00:00");
        $time2 = strtotime("2026-07-28 22:10:00");

        echo $time1.'<br>';
        echo $time2.'<br>time2 - time1 = ';
        echo round($time2 - $time1).'<br>';

        $time3 = '1787155115';
        echo $time3.'<br>';
        echo date("Y-m-d H:i:s",$time3);


        // $data = Db::name('users')->where($where)->order('winning_rate desc')->select();
        // foreach($data as $key => $v){
        //     $px = $key+1;
        // //     $lottery_id = $v['lottery_id'];
        // //     $asian_a = $v['asian_a'];
        // //     $america_a = $v['america_a'];
        // //     $europe_a = $v['europe_a'];
        // //     $africa_a = $v['africa_a'];
        // //     $oceania_a = $v['oceania_a'];
        //     $userId = $v['id'];
        //     $updata = [];
        //     if($v['winning_rate'] > 85 && $userId <= 2008){
        //         $updata['winning_rate'] = 80;
        //         $updata['winning'] = round($v['predicted_total']*0.8);
        //     }
        //     if($v['winning_rate'] > 85 && $userId <= 2008){
        //         $updata['winning_rate'] = 80;
        //         $updata['winning'] = round($v['predicted_total']*0.8);
        //     }
        //     //$updata['guess_ranking'] = $px;
        //     if(!empty($updata)){
        //         // Db::name('users')->where([['id','=',$userId]])->update($updata);
        //         unset($updata);
        //     }
        //     echo $px.'、'.$v['user_name'].'=='.$v['winning_rate'].'%; 推荐：'.$v['predicted_total'].' OK！<br>';

        // }


    }

}
?>