<?php


namespace app\common\model\serviceapi;


use app\common\model\ServiceApi;

/**
 * 功能描述 华安车险车辆信息
 * Class Car
 * @package app\common\model\commapi
 * Date: 2020/7/21
 * Time: 16:00
 * @author nyq
 */
class Car extends ServiceApi
{
    protected $table = "sos_car_car";
    protected $pk = "id";

    /**
     * 函数功能描述 根据用户信息查询车辆
     * @param $data
     * Date: 2020/7/21
     * Time: 16:50
     * @author nyq
     */
    public function getCar($data) {
        $res = static::where($data)->find();
        return $res;
    }


    /**
     * 函数功能描述 添加车辆信息
     * @param $data
     * Date: 2020/7/21
     * Time: 16:20
     * @author nyq
     */
    public function addCar($data) {
        $res = static::insertGetId($data);
        return $res;

    }

    /**
     * 函数功能描述 根据用户信息修改车辆信息
     * @param $where
     * @param $data
     * Date: 2020/7/21
     * Time: 16:22
     * @author nyq
     */
    public function updateCar($where, $data) {

        $res = static::where($where)->update($data);
        return $res;
    }

}