<?php


namespace App\Http\Controllers\Admin;


use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class BuryingPointController
{
    protected $blacklist = [30010, 30100, 10710, 20707, 10711, 20705, 20704, 10500, 10504, 10506, 10200, 10203, 10220, 10221, 10222, 10618, 10619, 10620, 20606, 20612, 10400, 10413, 10405, 10300, 10307, 10308,20706,10618,20607];
    public function weight()
    {


         $list = DB::table('agent.dbo.record_operate_config')->whereIn('OperateType',$this->blacklist)->get();
         return view('admin.burying_point.weight',[
             'list' => $list
         ]);
//        $list = DB::table('QPRecordDB.dbo.YN_RecordOperateLog')->groupBy('OperateType')->pluck('OperateType');
//        foreach ($list as $value){
//            $data[] = ['OperateType'=>$value];
//        }
//        DB::table('agent.dbo.record_operate_config')->insert($data);

    }

    public function update(Request $request,$OperateType)
    {

        $sort = $request->sort ?: 0;
        DB::table('agent.dbo.record_operate_config')->where('OperateType',$OperateType)->update(['sort'=>$sort]);
        return apiReturnSuc();
    }
}
