|
|
|
@ -443,38 +443,13 @@ class SafeController extends BaseController{
|
|
|
|
|
|
|
|
|
|
public function safeDocument() {
|
|
|
|
|
$time = time();
|
|
|
|
|
$today = date('Y-m-d');
|
|
|
|
|
$username = $_REQUEST['username'];
|
|
|
|
|
$tsession =S($today);
|
|
|
|
|
if(S($username)) {
|
|
|
|
|
$code = S($username);
|
|
|
|
|
}else {
|
|
|
|
|
if(!empty($tsession)) {
|
|
|
|
|
$num = $tsession + 1;
|
|
|
|
|
}else {
|
|
|
|
|
$num = 1;
|
|
|
|
|
}
|
|
|
|
|
$promoteRs = M('promote','tab_')->where(['account'=>$username])->getField('create_time',true);
|
|
|
|
|
$code = date('Ymd',$promoteRs[0])."_".$num;
|
|
|
|
|
}
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
$sn = date('Ymd') . '-' . strtoupper(substr(md5($loginPromote['id']), 8, 16));
|
|
|
|
|
|
|
|
|
|
$endTime = date('Y-m-d',strtotime('+1 year'));
|
|
|
|
|
$this->assign('time',date('Y-m-d',$time));
|
|
|
|
|
$this->assign('endTime',$endTime);
|
|
|
|
|
$this->assign('code',$code);
|
|
|
|
|
$this->assign('username',$username);
|
|
|
|
|
$this->assign('sn',$sn);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function ajaxAgree() {
|
|
|
|
|
$username = $_REQUEST['username'];
|
|
|
|
|
$code = $_REQUEST['code'];
|
|
|
|
|
$today = date('Y-m-d');
|
|
|
|
|
if(empty(S($username))) {
|
|
|
|
|
S($username, $code);
|
|
|
|
|
$t = S($today);
|
|
|
|
|
S($today,$t+1);
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(['code'=>10000]);
|
|
|
|
|
}
|
|
|
|
|
}
|