<?php
/*
 +----------------------------------------------------------------------
 | TEMMOKUMVC [ NO BEST, ONLY BETTER ]
 +----------------------------------------------------------------------
 | Copyright (c) 2018~2019 https://www.temmoku.cn All rights reserved.
 +----------------------------------------------------------------------
 | Author: 张宗强 Email:webmaster@temmoku.cn QQ:158726877 516669373 TEL:17895221001 微信:temmokumvc
 +---------------------------------------------------------------------- 
*/
namespace admin\public_class;
use \temmoku\lib\integral;
class renzheng {
	
	public function give($uid,$type){
		hook_listen('public_renzheng_give_begin',['uid'=>$uid,'type'=>$type]);
		$renzheng=unserialize(C('renzheng'));
		if($renzheng[$type]){
			//赠送积分
			$array=['code'=>0,'text'=>'赠送成功'];
			$_type=['mob'=>'手机号码','email'=>'Email','main'=>'主体信息'];
			if($renzheng[$type]['is_give']==1 && $renzheng[$type]['give']){
				(new integral)->add($uid,$renzheng[$type]['give'],'认证'.$_type[$type].'赠送积分');
			}else if($renzheng[$type]['is_give']==2  && $renzheng[$type]['give']){//赠送人民币
				if(is_plugin('rmb')){
					(new \plugin\rmb\public_class\put)->add($uid,$renzheng[$type]['give'],'认证'.$_type[$type].'赠送人民币');
				}else{
					$array=['code'=>1,'text'=>'没有安装人民币插件,认证失败。请联系客服操作'];
				}
			}
		}
		hook_listen('public_renzheng_give_end',['uid'=>$uid,'type'=>$type]);
		return $array;
	}
}
?>