|
@@ -5,6 +5,8 @@ namespace SixShop\Points\Entity;
|
|
|
use SixShop\Core\Entity\BaseEntity;
|
|
use SixShop\Core\Entity\BaseEntity;
|
|
|
use SixShop\Points\Enum\UserPointTypeEnum;
|
|
use SixShop\Points\Enum\UserPointTypeEnum;
|
|
|
use SixShop\Points\Model\UserPointLogModel;
|
|
use SixShop\Points\Model\UserPointLogModel;
|
|
|
|
|
+use think\db\Query;
|
|
|
|
|
+use think\Paginator;
|
|
|
|
|
|
|
|
class UserPointEntity extends BaseEntity
|
|
class UserPointEntity extends BaseEntity
|
|
|
{
|
|
{
|
|
@@ -42,4 +44,16 @@ class UserPointEntity extends BaseEntity
|
|
|
]);
|
|
]);
|
|
|
return $userPoint;
|
|
return $userPoint;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public function getUserList(array $params, array $pageAndLimit): Paginator
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->alias('l')
|
|
|
|
|
+ ->leftJoin('user u', 'u.id = l.user_id')
|
|
|
|
|
+ ->withSearch(['keyword' =>function (Query $query, string $keyword){
|
|
|
|
|
+ $keyword && $query->where('u.nickname|u.mobile|u.id', 'like', $keyword);
|
|
|
|
|
+ }], $params)
|
|
|
|
|
+ ->group('l.user_id')
|
|
|
|
|
+ ->field( ['u.id', 'u.avatar', 'u.nickname', 'u.mobile', 'l.point', 'l.update_time'])
|
|
|
|
|
+ ->paginate($pageAndLimit);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|