AdVisitStat.php 843 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Modules\Statistic\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * CREATE TABLE `ad_visit_stats` (
  6. * `id` int(11) NOT NULL AUTO_INCREMENT,
  7. * `bid` int(11) NOT NULL,
  8. * `uid` int(11) NOT NULL,
  9. * `cid` int(11) NOT NULL,
  10. * `type` char(10) NOT NULL COMMENT '类型,曝光,点击,解锁成功',
  11. * `created_at` datetime NOT NULL,
  12. * `updated_at` datetime NOT NULL,
  13. * PRIMARY KEY (`id`)
  14. * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告访问统计';
  15. *
  16. */
  17. class AdVisitStat extends Model
  18. {
  19. protected $table = 'ad_visit_stats';
  20. protected $fillable = ['bid','uid','cid','type'];
  21. public function setCurrentTable($time=''){
  22. if($time){
  23. $this->setTable('ad_visit_stats'.$time);
  24. }else{
  25. $this->setTable('ad_visit_stats');
  26. }
  27. }
  28. }