|
|
@ -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("参数非法");
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
$exists = M("promote", "tab_")->where(array('id' => $promoteId))->find();
|
|
|
|
if ($promoteId) {
|
|
|
|
if (!$exists) {
|
|
|
|
$exists = M("promote", "tab_")->where(array('id' => $promoteId))->find();
|
|
|
|
$this->error("参数非法.");
|
|
|
|
if (!$exists) {
|
|
|
|
|
|
|
|
$this->error("链接失效,请重新向推广员索取链接.");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*if ($user) {
|
|
|
|
|
|
|
|
redirect(U("ssg/index"));
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
$this->assign("promote_id", $promoteId);
|
|
|
|
$this->assign("promote_id", $promoteId);
|
|
|
|
$this->display();
|
|
|
|
$this->display();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -48,13 +52,16 @@ 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 = M("promote", "tab_")->where(array('id' => $promoteId))->find();
|
|
|
|
$promote = array();
|
|
|
|
if (!$promote) {
|
|
|
|
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" => "参数非法."));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//var_dump($password);
|
|
|
|
//var_dump($password);
|
|
|
@ -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(
|
|
|
|