User.php 501 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 用户模型
  6. */
  7. class User extends Model
  8. {
  9. protected $name = 'StoreMember';
  10. //protected $resultSetType = 'collection';// 设置返回类型
  11. public function wallet()
  12. {
  13. return $this->hasOne('UserWallet','user_id','id');
  14. }
  15. // 批量获取员工信息
  16. public static function getUserList($ids,$field = "*")
  17. {
  18. return static::field($field)->where('id','in',$ids)->select()->toArray();
  19. }
  20. }