|
|
@@ -4,6 +4,7 @@ namespace app\common\dao\shared;
|
|
4
|
4
|
|
|
5
|
5
|
use app\common\dao\BaseDao;
|
|
6
|
6
|
use app\common\model\shared\SharedProsperityUser;
|
|
|
7
|
+use app\entity\data\shared\SharedProsperityUserEntity;
|
|
7
|
8
|
|
|
8
|
9
|
class SharedProsperityUserDao extends BaseDao
|
|
9
|
10
|
{
|
|
|
@@ -12,4 +13,29 @@ class SharedProsperityUserDao extends BaseDao
|
|
12
|
13
|
{
|
|
13
|
14
|
return SharedProsperityUser::class;
|
|
14
|
15
|
}
|
|
|
16
|
+
|
|
|
17
|
+ /**
|
|
|
18
|
+ * @param array $userIdList
|
|
|
19
|
+ * @return SharedProsperityUserEntity[]
|
|
|
20
|
+ */
|
|
|
21
|
+ public function getSharedProsperityUserEntityListByUserIdList(array $userIdList): array
|
|
|
22
|
+ {
|
|
|
23
|
+ $entityList = [];
|
|
|
24
|
+ try {
|
|
|
25
|
+ /** @var SharedProsperityUser $model */
|
|
|
26
|
+ $model = $this->getModel();
|
|
|
27
|
+ $dataRes = $model::getDB()
|
|
|
28
|
+ ->whereIn('user_id', $userIdList)
|
|
|
29
|
+ ->select()
|
|
|
30
|
+ ->toArray();
|
|
|
31
|
+ if (!empty($dataRes)) {
|
|
|
32
|
+ $entityList = array_map(function ($data) {
|
|
|
33
|
+ return SharedProsperityUserEntity::newInstance($data);
|
|
|
34
|
+ }, $dataRes);
|
|
|
35
|
+ }
|
|
|
36
|
+ } catch (\Exception $e) {
|
|
|
37
|
+
|
|
|
38
|
+ }
|
|
|
39
|
+ return $entityList;
|
|
|
40
|
+ }
|
|
15
|
41
|
}
|