ViewUserSkill.php 708 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 模型
  6. */
  7. class ViewUserSkill extends Model
  8. {
  9. // 开启自动写入时间戳字段
  10. protected $autoWriteTimestamp = 'int';
  11. /**
  12. * 根据用户ID获取该用户所有技能-只做显示
  13. */
  14. public function getSkillInfo($user_id) {
  15. $where = [];
  16. $where["user_id"] = $user_id;
  17. return Model("ViewUserSkill")->where($where)->column("skill_name");
  18. }
  19. /**
  20. * 根据用户ID获取该用户所有技能-带ID
  21. */
  22. public function getSkillInfoId($user_id) {
  23. $where = [];
  24. $where["user_id"] = $user_id;
  25. return Model("ViewUserSkill")->where($where)->select();
  26. }
  27. }