WorkPoint.php 494 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. class WorkPoint extends BaseModel
  4. {
  5. public function getStatusOptions()
  6. {
  7. return Option::select('key as id', 'name')->where([
  8. ['table', 'work_points'],
  9. ['column', 'status']
  10. ])->get();
  11. }
  12. public function project()
  13. {
  14. return $this->belongsTo('App\Models\Project', 'project_id');
  15. }
  16. public static function getOptions()
  17. {
  18. return self::where('id', '>', 0)->get()->toArray();
  19. }
  20. }