DividendLogDao.php 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\common\dao\dividend;
  3. use app\common\dao\BaseDao;
  4. use app\common\model\dividend\DividendLog;
  5. use app\entity\data\dividend\DividendLogEntity;
  6. class DividendLogDao extends BaseDao
  7. {
  8. protected function getModel(): string
  9. {
  10. return DividendLog::class;
  11. }
  12. /**
  13. * @param array $idList
  14. * @return DividendLogEntity[]
  15. */
  16. public function getDividendLogEntityListByIdList(array $idList): array
  17. {
  18. $entityList = [];
  19. try {
  20. /** @var DividendLog $model */
  21. $model = $this->getModel();
  22. $dataRes = $model::getDB()
  23. ->whereIn('id', $idList)
  24. ->select()
  25. ->toArray();
  26. if (!empty($dataRes)) {
  27. $entityList = array_map(function ($data) {
  28. return DividendLogEntity::newInstance($data);
  29. }, $dataRes);
  30. }
  31. } catch (\Exception $e) {
  32. }
  33. return $entityList;
  34. }
  35. }