1234567891011121314151617181920212223242526 |
- <?php
- namespace app\common\model;
- class SoldierVideoModel extends BaseModel
- {
- // 设置表名
- protected $name = 'soldier_video';
- // 常量
- const STATUS = [1 => '显示', 2 => '隐藏'];
- const STATUS_SHOW = 1;
- const STATUS_HIDE = 2;
- public function getStatusTextAttr($value, $data)
- {
- return self::STATUS[$data['status']];
- }
- public function series()
- {
- return $this->hasOne(SoldierVideoSeriesModel::class, 'id', 'series_id');
- }
- }
|