DictDetail.php 521 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Repositories\Models\Base;
  3. use App\Repositories\Models\Model;
  4. class DictDetail extends Model
  5. {
  6. /**
  7. * @var string
  8. */
  9. protected $table = 'base_dict_detail';
  10. protected $guarded = [];
  11. /**
  12. * The attributes excluded from the model's JSON form.
  13. *
  14. * @var array
  15. */
  16. protected $hidden = [
  17. ];
  18. public static function checkValueIsUnique($dict_id, $value)
  19. {
  20. return self::where('dict_id', $dict_id)->where('value', $value)->exists();
  21. }
  22. }