| 1234567891011121314151617181920212223242526272829303132333435363738394041 | 
							- <?php
 
- namespace app\common\model;
 
- use think\Model;
 
- /**
 
-  * 模型
 
-  */
 
- class UserAuth extends Model
 
- {
 
-     // 开启自动写入时间戳字段
 
-     protected $autoWriteTimestamp = 'int';
 
-     // 定义时间戳字段名
 
-     protected $createTime = 'createtime';
 
-     /**
 
-      * 获取用户是否已经实名认证
 
-      */
 
-     public static function userIsAuth($user_id) {
 
-         // 判断当前用户是否实名认证
 
-         $userAuthInfo = self::where(["user_id"=>$user_id])->find();
 
-         $res = [];
 
-         $res['status'] = 1;
 
-         $res['msg'] = "已实名!";
 
-         if($userAuthInfo) {
 
-             if($userAuthInfo->status == 0) {
 
-                 $res['status'] = 0;
 
-                 $res['msg'] = "您的实名认证还在审核中...,请耐心等待!";
 
-             } elseif($userAuthInfo->status == 2) {
 
-                 $res['status'] = 0;
 
-                 $res['msg'] = "您的实名认证审核未通过,请重新审核!";
 
-             }
 
-         } else {
 
-             $res['status'] = 0;
 
-             $res['msg'] = "请先申请实名认证!";
 
-         }
 
-         return $res;
 
-     }
 
- }
 
 
  |