1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace app\common\model;
- use think\Model;
- class Specialist extends Model
- {
- protected $autoWriteTimestamp = false;
- const SEX_UNKNOW = 0;
- const SEX_MAN = 1;
- const SEX_WOMAN = 2;
- const SEXS = [
- self::SEX_UNKNOW => '未知',
- self::SEX_MAN => '男',
- self::SEX_WOMAN => '女'
- ];
- //sex_text
- public function getSexTextAttr($value, $data)
- {
- return self::SEXS[$data['sex']]??'';
- }
- //关联地址
- public function address()
- {
- return $this->belongsTo('Address');
- }
- }
|