<?php

namespace App\Http\Controllers\V1;

use App\Models\Help;
use App\Models\Region;
use Illuminate\Http\Request;
use App\Models\Advertise;
use App\Models\Setting;
use Hamcrest\Type\IsString;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Validator;

class ArticleController extends Controller
{
    //帮助类型
    public function helpList()
    {
        $list = Help::query()->select('id', 'title')->get();

        if($list->isEmpty()){
            return [];
        }
        $list = $list->toArray();

        return $this->success($list);
    }

    //帮助类答案
    public function answer(Request $request)
    {
        $info = Help::query()->where('id', $request->id)->first();
        $info->look_num = $info->look_num +1;
        $info->save();

        return $this->success($info);
    }

}
