Qw.php 430 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Model\qw;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Qw extends Model
  5. {
  6. public $table = "jm_qw";
  7. protected $appends = [
  8. 'category_desc'
  9. ];
  10. public $timestamps = false;
  11. /**
  12. * 部门描述
  13. */
  14. public function getCategoryDescAttribute()
  15. {
  16. $qwCategory = QwCategory::find($this->category_id);
  17. return $qwCategory->category_name ?? '';
  18. }
  19. }