OrganizationVaccine.php 562 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class OrganizationVaccine extends Model
  5. {
  6. const FREETYPE = 1, NOFREETYPE =2;
  7. protected static $_type = [
  8. self::FREETYPE => 'Ⅰ类',
  9. self::NOFREETYPE => 'Ⅱ类',
  10. ];
  11. public static function getType(){
  12. return self::$_type;
  13. }
  14. public function organization()
  15. {
  16. return $this->hasOne(Organization::class,'id','org_id');
  17. }
  18. public function vaccine()
  19. {
  20. return $this->hasOne(Vaccine::class,'id','vaccine_id');
  21. }
  22. }