getModel(); $dataRes = $model::getDB() ->whereIn('id', $idList) ->select() ->toArray(); if (!empty($dataRes)) { $entityList = array_map(function ($data) { return UserWithdrawalLimitRecordEntity::newInstance($data); }, $dataRes); } } catch (\Exception $e) { } return $entityList; } /** * 批量更新 * @param $dataList * @return array */ public function saveAll($dataList): array { try { return $this->getModel()::getInstance()->allowField(array_keys(reset($dataList)))->saveAll($dataList)->toArray(); } catch (\Exception $e) { return []; } } /** * @param string $typeShop * @param array $orderSnList * @return UserWithdrawalLimitRecordEntity[] */ public function getUserWithdrawalLimitRecordEntityListByOrderSnListAndPending(string $typeShop, array $orderSnList): array { $entityList = []; try { /** @var UserWithdrawalLimitRecord $model */ $model = $this->getModel(); $dataList = $model::getDB() ->where('type_shop', '=', $typeShop) ->whereIn('order_sn', $orderSnList) ->where('status', '=', UserWithdrawalLimitRecordEnum::STATUS['PENDING']['code']) ->select() ->toArray(); if (!empty($dataList)) { $entityList = array_map(function ($data) { return UserWithdrawalLimitRecordEntity::newInstance($data); }, $dataList); } } catch (DataNotFoundException|ModelNotFoundException|DbException $e) { } return $entityList; } }