<?php
/**
 * Created by PhpStorm.
 * User: z-yang
 * Date: 2019/1/7
 * Time: 14:22
 */

namespace App\Modules\Statistic\Services;

use App\Modules\Statistic\Models\AdVisitStat;

class AdVisitStatService
{
    public static function create($uid,$bid,$cid,$type){
        try{
            AdVisitStat::create(compact('uid','bid','cid','type'));
        }catch (\Exception $e){

        }
    }

    public static function getInfo($uid,$cid,$type){
        return AdVisitStat::where('uid',$uid)->where('cid',$cid)->where('type',$type)->first();
    }

    public static function getInfoV2($uid,$cid,$type){
        return AdVisitStat::where('uid',$uid)->where('cid',$cid)->whereIn('type',$type)->first();
    }
}