|
@@ -6,11 +6,14 @@
|
|
|
* Time: 上午11:42
|
|
|
*/
|
|
|
|
|
|
-require_once (BASE_ROOT_PATH . '/helper/algorithm.php');
|
|
|
-require_once (BASE_ROOT_PATH . '/helper/login_helper.php');
|
|
|
-require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
|
|
|
-require_once (BASE_ROOT_PATH . '/helper/sms_helper.php');
|
|
|
-require_once (BASE_ROOT_PATH . '/helper/url_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/algorithm.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/login_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/sms_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/url_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/model_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/invite_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/third_author/wxauthor.php');
|
|
|
|
|
|
|
|
|
class invite_friendControl extends mobileControl
|
|
@@ -23,6 +26,14 @@ class invite_friendControl extends mobileControl
|
|
|
public function indexOp()
|
|
|
{
|
|
|
$user = intval($_GET['relay_id']);
|
|
|
+ if(session_helper::need_wechat_author())
|
|
|
+ {
|
|
|
+ $author = new thrid_author\wxauthor();
|
|
|
+ $url = "/mobile/index.php?act=invite_friend&op=index&relay_id={$user}";
|
|
|
+ $url = $author->enter($url);
|
|
|
+ return self::outsuccess(['direct_uri' => $url],"redirect");
|
|
|
+ }
|
|
|
+
|
|
|
if($user <= 0)
|
|
|
{
|
|
|
if(session_helper::logined()) {
|
|
@@ -30,7 +41,18 @@ class invite_friendControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return self::outsuccess(['tpl' => new tpl_invite_friend($user)],"invite_friend/invite",'wap');
|
|
|
+ if(session_helper::logined()) {
|
|
|
+ $type_sn = "";
|
|
|
+ } else {
|
|
|
+ $type_sn = account_helper::invite_bonus($user);
|
|
|
+ }
|
|
|
+
|
|
|
+ if($user > 0) {
|
|
|
+ return self::outsuccess(['tpl' => new tpl_invite_friend($user,$type_sn)],"invite_friend/invite",'wap');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return self::outerr(errcode::ErrParamter);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -39,12 +61,16 @@ class tpl_invite_friend
|
|
|
private $mUser;
|
|
|
private $mInvitees;
|
|
|
private $mUserInfo;
|
|
|
+ private $mShareInfo;
|
|
|
+ private $mTypesn;
|
|
|
|
|
|
- public function __construct($user)
|
|
|
+ public function __construct($user,$type_sn)
|
|
|
{
|
|
|
$this->mUser = $user;
|
|
|
$this->mInvitees = [];
|
|
|
$this->init($user);
|
|
|
+ $this->mShareInfo = invite_helper::share_info(session_helper::share_id());
|
|
|
+ $this->mTypesn = $type_sn;
|
|
|
}
|
|
|
|
|
|
private function init($user)
|
|
@@ -68,6 +94,10 @@ class tpl_invite_friend
|
|
|
public function show()
|
|
|
{
|
|
|
$this->show_relay();
|
|
|
+ if(!empty($this->mTypesn)) {
|
|
|
+ $this->show_bonus();
|
|
|
+ }
|
|
|
+
|
|
|
$this->show_invitees();
|
|
|
}
|
|
|
private function show_relay()
|
|
@@ -90,6 +120,11 @@ class tpl_invite_friend
|
|
|
echo $str;
|
|
|
}
|
|
|
|
|
|
+ private function show_bonus()
|
|
|
+ {
|
|
|
+ $url = url_helper::bonus_grab_url($this->mTypesn);
|
|
|
+ }
|
|
|
+
|
|
|
private function show_invitees()
|
|
|
{
|
|
|
echo "<div class=\"bonus_list\">";
|
|
@@ -103,7 +138,6 @@ class tpl_invite_friend
|
|
|
{$minfo->nickname()}
|
|
|
</div>
|
|
|
<div class=\"bonus_pro text-overflow\">
|
|
|
- 加入了你的人脉圈,奖励奖励奖励奖励奖励
|
|
|
</div>
|
|
|
<div class=\"bonus_price text-overflow\">
|
|
|
<span>{$minfo->reward_amount()}</span>元
|
|
@@ -120,14 +154,14 @@ class tpl_invite_friend
|
|
|
}
|
|
|
public function share_title()
|
|
|
{
|
|
|
- return "边买边赚钱";
|
|
|
+ return $this->mShareInfo['title'];
|
|
|
}
|
|
|
public function share_image()
|
|
|
{
|
|
|
- return "";
|
|
|
+ return $this->mShareInfo['img'];;
|
|
|
}
|
|
|
public function share_subtitle()
|
|
|
{
|
|
|
- return "边买边赚钱";
|
|
|
+ return $this->mShareInfo['sub_title'];;
|
|
|
}
|
|
|
}
|