MatchmakerUserModel.php 1012 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 老猫 <thinkcmf@126.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\matchmaker\model;
  12. use think\Model;
  13. class MatchmakerUserModel extends Model
  14. {
  15. protected $type = [
  16. 'family' => 'array',
  17. ];
  18. public function matchmaker()
  19. {
  20. return $this->hasOne(MatchmakerModel::class,'id','matchmaker_id');
  21. }
  22. public function getSexTextAttr($value, $data)
  23. {
  24. $sex = ['保密', '男', '女'];
  25. return $sex[$data['sex']];
  26. }
  27. }