Merge branch 'supersign' into dev

master
tpingzhang 5 years ago
commit 057ccc9f4c

@ -19,22 +19,26 @@ class SsgController extends BaseController {
const RETURN_FALSE = 2;
public function login(){
public function login()
{
$promoteId = I("promote_id", 0);
$user = session("user_auth");
$promoteId = I("promote_id");
if (!$promoteId) {
if ($user) {
redirect(U("ssg/index", array('promete_id' => $promoteId)));
}
/*if (!$promoteId) {
echo "链接失效,请重新向推广员索取链接。";
exit();
$this->error("参数非法");
}
}*/
if ($promoteId) {
$exists = M("promote", "tab_")->where(array('id' => $promoteId))->find();
if (!$exists) {
$this->error("参数非法.");
$this->error("链接失效,请重新向推广员索取链接.");
}
}
/*if ($user) {
redirect(U("ssg/index"));
}*/
$this->assign("promote_id", $promoteId);
$this->display();
}
@ -48,14 +52,17 @@ class SsgController extends BaseController {
{
$account = I("Account");
$password = I("Password");
$promoteId = I("promote_id");
if (!$promoteId) {
$promoteId = I("promote_id", 0);
/*if (!$promoteId) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法"));
}
}*/
$promote = array();
if ($promoteId) {
$promote = M("promote", "tab_")->where(array('id' => $promoteId))->find();
if (!$promote) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法."));
}
}
//var_dump($password);
$verify = new \Think\Verify();
@ -87,7 +94,7 @@ class SsgController extends BaseController {
$user = M('user', 'tab_')->where(array(
'id' => $user_id
))->find();
if (!$user['promote_id']) {
if (!$user['promote_id'] && $promote) {
M('user', 'tab_')->where(array(
'id' => $user_id
))->save(array(

@ -38,7 +38,7 @@
</ul>
</div>
<div class="login-btn"><a href="javascript:;" onclick="Login()">登录</a></div>
<div style="padding-top: 0.2rem;" class="login-btn"><a href="https://m.wmtxkj.com/mobile.php?s=/User/step1.html">注册</a></div>
<div style="padding-top: 0.2rem;" class="login-btn"><a href="/mobile.php?s=/User/step1.html">注册</a></div>
</div>
</div>
</body>

Loading…
Cancel
Save