<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ScoresLogs extends Model
{
    //指定表名
    protected $table ='scores_logs';
    // 拒绝添加的字段
    protected $guarded = [];
    public $timestamps = false;

    //添加
    public function addModel($param){

        if (empty($param['serid'])){
            return ['Data'=>'','ErrorCode'=>3,'ErrorMessage'=>'服务商ID不能为空'];

        }
        if(empty($param['dctscore'])){
            return ['Data'=>'','ErrorCode'=>4,'ErrorMessage'=>'分数不能为空'];
        }
        $res = $this->insert($param);
        if ($res){
            return ['Data'=>'','ErrorCode'=>1,'ErrorMessage'=>'添加成功'];
        }else{
            return ['Data'=>'','ErrorCode'=>2,'ErrorMessage'=>'添加失败'];
        }
    }


}
