SoldierVideoModel.php 497 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\common\model;
  3. class SoldierVideoModel extends BaseModel
  4. {
  5. // 设置表名
  6. protected $name = 'soldier_video';
  7. // 常量
  8. const STATUS = [1 => '显示', 2 => '隐藏'];
  9. const STATUS_SHOW = 1;
  10. const STATUS_HIDE = 2;
  11. public function getStatusTextAttr($value, $data)
  12. {
  13. return self::STATUS[$data['status']];
  14. }
  15. public function series()
  16. {
  17. return $this->hasOne(SoldierVideoSeriesModel::class, 'id', 'series_id');
  18. }
  19. }