修改bug

master
ELF 5 years ago
parent ef9cb4e2c4
commit 0d91f0aa5c

@ -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]);
}
}

@ -51,7 +51,7 @@ and open the template in the editor.
<div class="title"><h2>游戏推广服务框架协议</h1></div>
<div class="text">
<p>本协议由以下双方于<span>{$time}</span>签订:</p>
<p>合同编号:{$code}</p>
<p>合同编号:{$sn}</p>
<p style="font-weight: bold">甲方:海南万盟天下科技有限公司</p>
<p>注册地址海南省海口市南海大道26号海口国家高新区创业孵化中心A楼5层A1-1268室</p>
<p>联系电话13067391751</p>
@ -237,8 +237,6 @@ and open the template in the editor.
</div>
<button id="ag" style="width:120px;height:40px;background: #26C7DB;color:white;border:none" >同意</button>
<input type="hidden" id='us' value="{$username}"/>
<input type="hidden" id='code' value="{$code}"/>
<br><br><br><br>
<br><br><br><br>
</div>
@ -247,21 +245,11 @@ and open the template in the editor.
$(function() {
var username = document.getElementById('us').value;
var code = document.getElementById('code').value;
$("#ag").on('click',function(event) {
$.ajax({
type:"POST",
url:"{:U('Safe/ajaxAgree')}",
data:{'username':username,'code':code},
dataType:'json',
success:function(res) {
window.localStorage.setItem('checked','checked');
window.history.back(-1);
}
window.location.href = "/index.php?s=/Home/Safe/modifyBaseInfo.html"
});
})
})
</script>
</html>

Loading…
Cancel
Save