From c2fbf2c141cd10b3feab8498d6274fea4bdcc7f9 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Fri, 11 Oct 2019 15:29:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AD=BE=20=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=B8=A0=E9=81=93=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/Controller/SsgController.class.php | 43 +++++++++++-------- Application/Mobile/View/Ssg/login.html | 2 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index 79488797a..894fbe205 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -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("参数非法"); - } - $exists = M("promote", "tab_")->where(array('id' => $promoteId))->find(); - if (!$exists) { - $this->error("参数非法."); - } - - /*if ($user) { - redirect(U("ssg/index")); }*/ + if ($promoteId) { + $exists = M("promote", "tab_")->where(array('id' => $promoteId))->find(); + if (!$exists) { + $this->error("链接失效,请重新向推广员索取链接."); + } + } + $this->assign("promote_id", $promoteId); $this->display(); } @@ -48,13 +52,16 @@ 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 = M("promote", "tab_")->where(array('id' => $promoteId))->find(); - if (!$promote) { - $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); @@ -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( diff --git a/Application/Mobile/View/Ssg/login.html b/Application/Mobile/View/Ssg/login.html index 31367ac15..ff0a56119 100644 --- a/Application/Mobile/View/Ssg/login.html +++ b/Application/Mobile/View/Ssg/login.html @@ -38,7 +38,7 @@
- +