UserModel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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\love\model;
  12. use think\Model;
  13. class UserModel extends Model
  14. {
  15. protected $type = [
  16. 'family' => 'array',
  17. 'more' => 'array',
  18. ];
  19. public function getSexTextAttr($value, $data)
  20. {
  21. $sex = ['保密', '男', '女'];
  22. return $sex[$data['sex']];
  23. }
  24. public function getStatusTextAttr($value, $data)
  25. {
  26. $arr = ['','单身不愿意推荐', '单身愿意推荐', '热恋','已婚'];
  27. return $arr[$data['status']];
  28. }
  29. }