<?php

/**
 * 警告记录
 * 2020-4-27 13:52:05
 * junshi
*/

class liveWarningModule extends commonModule
{
    public function __construct()
    {
        parent::__construct("sl_live_warning");
    }

    public function warning($request,$id){
        if (empty($request["type"])){
            returnFail([],"请选择类型",-1);
        }
        if (empty($request["content"])){
            returnFail([],"请输入内容",-1);
        }

        $data = [
            "user_number" => $id,
            "type" => $request["type"],
            "content" => $request["content"],
            "create_time" => date("Y-m-d H:i:s"),
        ];

        $res = $this->insert($data);
        if ($res){
            returnSuccess([],"警告主播成功",0);
        }else{
            returnFail([],"警告主播失败，请重试",-1);
        }

    }

}