UserSelectLogModel.php 1021 B

1234567891011121314151617181920212223242526272829303132
  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 UserSelectLogModel extends Model
  14. {
  15. // 定义全局的查询范围
  16. protected function base($query)
  17. {
  18. $query->where('delete_time',null);
  19. }
  20. public function user1()
  21. {
  22. return $this->hasOne(UserModel::class,'id','user_id1');
  23. }
  24. public function user2()
  25. {
  26. return $this->hasOne(UserModel::class,'id','user_id2');
  27. }
  28. }