Adv.php 597 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Author: 芸众商城 www.yunzshop.com
  4. * Date: 2018/3/23
  5. * Time: 下午8:26
  6. */
  7. namespace app\common\models;
  8. use app\common\models\BaseModel;
  9. use Illuminate\Database\Eloquent\Builder;
  10. class Adv extends BaseModel
  11. {
  12. public $table = 'yz_adv';
  13. public $timestamps = true;
  14. static protected $needLog = true;
  15. protected $guarded = [''];
  16. protected $casts = [
  17. 'advs' => 'json'
  18. ];
  19. public static function boot()
  20. {
  21. parent::boot();
  22. static::addGlobalScope(function (Builder $builder) {
  23. $builder->uniacid();
  24. });
  25. }
  26. }