AdVisitStatService.php 709 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: z-yang
  5. * Date: 2019/1/7
  6. * Time: 14:22
  7. */
  8. namespace App\Modules\Statistic\Services;
  9. use App\Modules\Statistic\Models\AdVisitStat;
  10. class AdVisitStatService
  11. {
  12. public static function create($uid,$bid,$cid,$type){
  13. try{
  14. AdVisitStat::create(compact('uid','bid','cid','type'));
  15. }catch (\Exception $e){
  16. }
  17. }
  18. public static function getInfo($uid,$cid,$type){
  19. return AdVisitStat::where('uid',$uid)->where('cid',$cid)->where('type',$type)->first();
  20. }
  21. public static function getInfoV2($uid,$cid,$type){
  22. return AdVisitStat::where('uid',$uid)->where('cid',$cid)->whereIn('type',$type)->first();
  23. }
  24. }