setCurrentTable(); }else{ $model->setCurrentTable($time); } try{ $model->uid = $uid; $model->bid = $bid; $model->cid = $cid; $model->type = $type; $model->save(); }catch (\Exception $e){ } } public static function getInfo($uid,$cid,$type){ $model = new AdVisitStat(); $time = date('Ym'); if($time == '201905'){ $model->setCurrentTable(); }else{ $model->setCurrentTable($time); } return AdVisitStat::where('uid',$uid)->where('cid',$cid)->where('type',$type)->first(); } public static function getInfoV2($uid,$cid,$type){ $model = new AdVisitStat(); $time = date('Ym'); if($time == '201905'){ $model->setCurrentTable(); }else{ $model->setCurrentTable($time); } return $model->where('uid',$uid)->where('cid',$cid)->whereIn('type',$type)->first(); } public static function getByUid($uid){ $model = new AdVisitStat(); $time = date('Ym'); if($time == '201905'){ $model->setCurrentTable(); }else{ $model->setCurrentTable($time); } return $model->where('uid',$uid)->select('id','type')->where('id','<=',12723415)->first(); } }