123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- // +----------------------------------------------------------------------
- // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
- // +----------------------------------------------------------------------
- // | Author: 萤火科技 <admin@yiovo.com>
- // +----------------------------------------------------------------------
- declare (strict_types = 1);
- namespace app\common\model\user;
- use app\common\model\BaseModel;
- /**
- * 用户认证
- * Class Delivery
- * @package app\common\model
- */
- class UserIdcards extends BaseModel
- {
-
- // 定义表名
- protected $name = 'user_idcards';
- // 定义主键
- protected $pk = 'id';
- public function getUserIdCard($userId){
- return self::where('user_id',$userId)->order('id','desc')->find();
- }
- /**
- * 获取器:隐藏身份证中间
- * @param $value
- * @return mixed
- */
- /* public function getIdCardAttr($value)
- {
- if (strlen($value) === 18) {
- return hide_id_card($value);
- }
- }*/
- /**
- * 检查用户是否已实名认证
- * @param $userId
- * @return bool
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public static function checkUserHasIdcard($userId){
- return boolval(self::where(['user_id'=>$userId])->find());
- }
- }
|