DiseaseCategoryProperties.php 751 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. class DiseaseCategoryProperties extends Model
  5. {
  6. public $table = "jm_disease_properties_category";
  7. public function getPropertiesCategory()
  8. {
  9. $options = self::select('id' , 'name' , 'label')->get();
  10. if(empty($options)) {
  11. return [];
  12. } else {
  13. $selectOption = [];
  14. foreach ($options as $option) {
  15. $selectOption[$option->id] = $this->jonitShowName($option->name , $option->label);
  16. }
  17. return $selectOption;
  18. }
  19. }
  20. private function jonitShowName($name , $label)
  21. {
  22. $label = DiseaseProperties::getLables($label);
  23. return $label.'-'.$name;
  24. }
  25. }