| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- /**
- * @package merchant
- *
- * @author xaboy
- * @day 2020-04-28
- *
- *
- */
- namespace app\common\dao\user;
- use app\common\dao\BaseDao;
- use app\common\model\BaseModel;
- use app\common\model\user\UserCertification;
- use app\entity\data\user\UserCertificationEntity;
- use think\db\exception\DataNotFoundException;
- use think\db\exception\DbException;
- use think\db\exception\ModelNotFoundException;
- /**
- * Class UserDao
- * @package app\common\dao\user
- * @author xaboy
- * @day 2020-04-28
- */
- class UserCertificationDao extends BaseDao
- {
- /**
- * @return BaseModel
- * @author xaboy
- * @day 2020-03-30
- */
- protected function getModel(): string
- {
- return UserCertification::class;
- }
- /**
- * @param array $idList
- * @return UserCertificationEntity[]
- */
- public function getUserCertificationEntityListByIdList(array $idList): array
- {
- $entityList = [];
- try {
- $dataList = UserCertification::getDB()
- ->whereIn('id', $idList)
- ->select()
- ->toArray();
- if (!empty($dataList)) {
- $entityList = array_map(function ($data) {
- return UserCertificationEntity::newInstance($data);
- }, $dataList);
- }
- } catch (DataNotFoundException|ModelNotFoundException|DbException $e) {
- }
- return $entityList;
- }
- /**
- * @param array $uidList
- * @return UserCertificationEntity[]
- */
- public function getUserCertificationEntityListByUidList(array $uidList): array
- {
- $entityList = [];
- try {
- $dataList = UserCertification::getDB()
- ->whereIn('uid', $uidList)
- ->select()
- ->toArray();
- if (!empty($dataList)) {
- $entityList = array_map(function ($data) {
- return UserCertificationEntity::newInstance($data);
- }, $dataList);
- }
- } catch (DataNotFoundException|ModelNotFoundException|DbException $e) {
- }
- return $entityList;
- }
- /**
- * @param $mobile
- * @return array|\think\db\BaseQuery|\think\Model|null
- * @throws DataNotFoundException
- * @throws DbException
- * @throws ModelNotFoundException
- * @author 史晨
- * @date 2025/10/20 17:21
- * 获取用户实名信息
- */
- public function getUserCertification($mobile)
- {
- return $this->getModel()::getDB()->where('mobile', $mobile)->find();
- }
- }
|