| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\common\dao\dividend;
- use app\common\dao\BaseDao;
- use app\common\model\dividend\DividendLog;
- use app\entity\data\dividend\DividendLogEntity;
- class DividendLogDao extends BaseDao
- {
- protected function getModel(): string
- {
- return DividendLog::class;
- }
- /**
- * @param array $idList
- * @return DividendLogEntity[]
- */
- public function getDividendLogEntityListByIdList(array $idList): array
- {
- $entityList = [];
- try {
- /** @var DividendLog $model */
- $model = $this->getModel();
- $dataRes = $model::getDB()
- ->whereIn('id', $idList)
- ->select()
- ->toArray();
- if (!empty($dataRes)) {
- $entityList = array_map(function ($data) {
- return DividendLogEntity::newInstance($data);
- }, $dataRes);
- }
- } catch (\Exception $e) {
- }
- return $entityList;
- }
- }
|