<?php


namespace App\Services;

use Illuminate\Support\Facades\DB;


class CreateLog
{

    // 添加配置日志
    public static function SystemStatusInfo_log($admin_id, $StatusName)
    {

        $data = [
            'admin_id' => $admin_id,
            'StatusName' => $StatusName,
            'create_at' => date('Y-m-d H:i:s')
        ];

        DB::connection('write')->table('agent.dbo.SystemStatusInfo_log')->updateOrInsert(['StatusName' => $StatusName], $data);
    }

    // 添加支付往三方的请求参数
    public static function pay_request($userPhone, $extra, $orderSn, $userEmail, $userId, $userName = '')
    {
        $data = [
            'order_sn' => $orderSn,
            'user_phone' => $userPhone,
            'extra' => $extra,
            'email' => $userEmail,
            'user_name' => $userName,
            'user_id' => $userId
        ];
        DB::connection('write')->table('agent.dbo.pay_request')->updateOrInsert(['order_sn' => $orderSn], $data);
    }

}
