<?php

namespace App\Http\Controllers\Admin\Account_logs;

use App\Models\AccountLog;
use Illuminate\Http\Request;
use App\Http\Controllers\Admin\Controller;

class InfoController extends Controller
{
    public function index(Request $request)
    {
        $id =  $request->id;
        $list = AccountLog::where('from_id',$id)->where('to_id',$id)
            ->where('op','charge')->orderBy('id','desc')->paginate(20);
        return view('admin.account_log.index',compact('list'));
    }

    public function destroy(Request $request)
    {
        $bool = AccountLog::destroy($request->id);
        if($bool) {
            return  $this->showMessage('操作成功');
        }else{
            return  $this->showWarning("操作失败");
        }
    }
}
