You've already forked qlg.tsgz.moe
addons
app_download_files
extend
hyhproject
admin
app
common
behavior
common
conf
exception
model
Addons.php
Ads.php
Aliyunoss.php
Areas.php
Auth.php
AuthFamily.php
Banks.php
Base.php
Brands.php
Carts.php
CashConfigs.php
CashDraws.php
ChargeItems.php
CompanyBank.php
Ectwallet.php
Express.php
Favorites.php
Goods.php
GoodsAppraises.php
GoodsCats.php
GoodsConsult.php
GoodsVirtuals.php
HomeMenus.php
Hooks.php
Informs.php
Invoices.php
LogMoneys.php
LogPayParams.php
LogPays.php
LogSms.php
MessageQueues.php
Messages.php
OrderComplains.php
OrderRefunds.php
Orders.php
Payments.php
Position.php
Settlements.php
ShopCats.php
ShopExtras.php
Shopping.php
Shops.php
SysConfigs.php
SysSummary.php
Systems.php
Table.php
Tags.php
UserAddress.php
UserLevel.php
UserReward.php
UserScores.php
UserTrees.php
UserVouchers.php
Users.php
taglib
validate
home
home2
mobile2
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
hyhproject.tar.gz
index.html
index.php
reg.lock
robots.txt
86 lines
2.5 KiB
PHP
Executable File
86 lines
2.5 KiB
PHP
Executable File
<?php
|
|
namespace wstmart\common\model;
|
|
use think\Db;
|
|
/**
|
|
* ============================================================================
|
|
* 验证处理类
|
|
*/
|
|
class Auth extends Base{
|
|
protected $table = '';
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$this->table = Db::name('auth_personal');
|
|
}
|
|
public function setTable($tableName='auth_company'){
|
|
$this->table = Db::name($tableName);
|
|
}
|
|
public function getStatusTextAttr($value,$data){
|
|
$status = [-1=>'已拒绝',0=>'待审核',1=>'已通过'];
|
|
return $status[$data['status']];
|
|
}
|
|
/**
|
|
* 获取单条信息
|
|
* @param [type] $where [description]
|
|
* @param string $field [description]
|
|
* @return [type] [description]
|
|
*/
|
|
public function getInfo($where,$field='*'){
|
|
return $this->table->where($where)->field($field)->find();
|
|
}
|
|
/**
|
|
* 获取单条信息
|
|
* @param [type] $where [description]
|
|
* @param string $field [description]
|
|
* @return [type] [description]
|
|
*/
|
|
public function getField($where,$field='id'){
|
|
return $this->table->where($where)->value($field);
|
|
}
|
|
/**
|
|
* 插入单条信息
|
|
* @param string $data [description]
|
|
* @return [type] [description]
|
|
*/
|
|
public function insertInfo($data){
|
|
$data['createTime'] = time();
|
|
return $this->table->insert($data);
|
|
}
|
|
/**
|
|
* 更新单条信息
|
|
* @param [type] $where [description]
|
|
* @param string $data [description]
|
|
* @return [type] [description]
|
|
*/
|
|
public function updateInfo($where,$data){
|
|
return $this->table->where($where)->update($data);
|
|
}
|
|
/**
|
|
* 根据手机号获取单条信息
|
|
* @param [type] $where [description]
|
|
* @param string $data [description]
|
|
* @return [type] [description]
|
|
*/
|
|
public function getAuthInfoByMobile($userPhone){
|
|
$where['userPhone']=$userPhone;
|
|
$where['dataFlag'] = 1;
|
|
$userInfo = getUserInfo($where,'userId,authType');
|
|
if(!$userInfo) return WSTReturn('手机号不存在');
|
|
|
|
if(1 == $userInfo['authType']){//个人认证
|
|
$field = 'householdName uName,householdIdCard idCard';
|
|
}elseif(0 == $userInfo['authType']){
|
|
return WSTReturn('请联系该用户实名认证');
|
|
}elseif(2 == $userInfo['authType']){
|
|
$this->setTable('auth_company');
|
|
$field = 'trueName uName,idCard';
|
|
//return WSTReturn('合作账号不可亲人认证');
|
|
}
|
|
$rs = $this->getInfo(['userId'=>$userInfo['userId']],$field);
|
|
if($rs){
|
|
return WSTReturn('成功',1,$rs);
|
|
}
|
|
return WSTReturn('获取失败,状态异常');
|
|
}
|
|
|
|
}
|