浏览代码

Merge branch 'master' of http://git.qiniu1314.com/Kirin/shenying

Kirin 1 年之前
父节点
当前提交
f589eb8539
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/dao/user/level/UserLevelDao.php

+ 2 - 2
app/dao/user/level/UserLevelDao.php

@@ -41,9 +41,9 @@ class UserLevelDao extends BaseDao
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
-    public function getUserLevel(int $uid, string $field = '*')
+    public function getUserLevel(int $uid, string $field = '*', $time = PHP_INT_MAX)
     {
-        return $this->getModel()->where('uid', $uid)->where('is_del', 0)->where('status', 1)->field($field)->with(['levelInfo'])->order('grade desc,add_time desc')->find();
+        return $this->getModel()->where('uid', $uid)->where('is_del', 0)->where('status', 1)->where('add_time', '<', $time)->field($field)->with(['levelInfo'])->order('grade desc,add_time desc')->find();
     }
 
     /**