超级签 官方渠道优化

master
tpingzhang 5 years ago
parent 386e119f15
commit c2fbf2c141

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

@ -38,7 +38,7 @@
</ul> </ul>
</div> </div>
<div class="login-btn"><a href="javascript:;" onclick="Login()">登录</a></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>
</div> </div>
</body> </body>

Loading…
Cancel
Save