You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
445 B

  1. <?php
  2. namespace App\Model\v3;
  3. use App\Model\Model;
  4. use Hyperf\Database\Model\Builder;
  5. class Employees extends Model
  6. {
  7. protected $table = 'lanzu_employees';
  8. protected $casts = [
  9. 'position' => 'array'
  10. ];
  11. protected function boot(): void
  12. {
  13. parent::boot();
  14. self::addGlobalScope('normal', function (Builder $builder) {
  15. $builder->where([$this->getTable().'.status' => 1]);
  16. });
  17. }
  18. }