<?php

namespace app\controller\Order;

use app\controller\ChargeOrder;
use think\facade\Db;

class TimeTask
{
    /**
     * @throws \RedisException
     */
    public function send()
    {
        $redis = new \Redis();
        $redis->connect('127.0.0.1', 6379);
    }

    public function AdmenAmont(): \think\response\Json
    {
        $list = Db::table("charge_order_longshuizhen")->whereBetweenTime("start_time", "2023-06-01", "2023-07-01")->select()->toArray();
//        return json($list);
        $jj = [];
        foreach ($list as $l) {
            if (round($l['SeviceMoney'] + $l['ElecMoney'], 2) != round($l["TotalMoney"], 2)) {
                $jj[] = $l['StartChargeSeq'];
            }
        }
//        foreach ($jj as $j) {
//            $order = new ChargeOrder();
//            $order->AmendmentAccount('charge_order_longshuizhen', $j);
//        }
        $list = Db::table("charge_order_longshuizhen")->whereBetweenTime("start_time", "2023-06-01", "2023-07-01")->select()->toArray();
        return json($jj);
    }

}