SystemBehavior.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace behavior\system;
  12. use app\admin\model\system\SystemAdmin;
  13. use app\admin\model\system\SystemLog;
  14. use think\Request;
  15. /**
  16. * 系统后台行为
  17. * Class SystemBehavior
  18. * @package behavior\system
  19. */
  20. class SystemBehavior
  21. {
  22. public static function adminVisit($adminInfo,$type = 'system')
  23. {
  24. if(strtolower(Request::instance()->controller()) != 'index') SystemLog::adminVisit($adminInfo->id,$adminInfo->account,$type);
  25. }
  26. public static function systemAdminLoginAfter($adminInfo)
  27. {
  28. SystemAdmin::edit(['last_ip'=>Request::instance()->ip(),'last_time'=>time()],$adminInfo['id']);
  29. }
  30. /**
  31. * 商户注册成功之后
  32. */
  33. public static function merchantRegisterAfter($merchantInfo)
  34. {
  35. }
  36. }