|
@@ -49,12 +49,12 @@ class user_indexControl extends mobileHomeControl
|
|
|
return self::outerr(errcode::ErrParamter);
|
|
|
}
|
|
|
|
|
|
-// if(session_helper::need_wechat_author()) {
|
|
|
-// $author = new thrid_author\wxauthor();
|
|
|
-// $url = url_helper::member_index($idolid);
|
|
|
-// $url = $author->enter($url);
|
|
|
-// return self::outsuccess(['direct_uri' => $url],"redirect");
|
|
|
-// }
|
|
|
+ if(session_helper::need_wechat_author()) {
|
|
|
+ $author = new thrid_author\wxauthor();
|
|
|
+ $url = url_helper::member_index($idolid);
|
|
|
+ $url = $author->enter($url);
|
|
|
+ return self::outsuccess(['direct_uri' => $url],"redirect");
|
|
|
+ }
|
|
|
|
|
|
if(session_helper::logined() == false)
|
|
|
{
|
|
@@ -85,20 +85,32 @@ class user_indexControl extends mobileHomeControl
|
|
|
|
|
|
private function open_page($idolid,$output = [])
|
|
|
{
|
|
|
- $minfo = new member_info($idolid);
|
|
|
- $relateion = new relation\mem_relation(session_helper::memberid());
|
|
|
- $isfriend = $relateion->is_friends($idolid);
|
|
|
- if($output['scene'] != 'applyer') {
|
|
|
- if(!$isfriend) {
|
|
|
- $output['scene'] = 'stranger';
|
|
|
- } else {
|
|
|
- $output['scene'] = 'friends';
|
|
|
+ try
|
|
|
+ {
|
|
|
+ $relation = new relation\mem_relation(session_helper::memberid());
|
|
|
+ $isfriend = $relation->is_friends($idolid);
|
|
|
+
|
|
|
+ if($output['scene'] != 'applyer')
|
|
|
+ {
|
|
|
+ if(!$isfriend) {
|
|
|
+ $output['scene'] = 'stranger';
|
|
|
+ } else {
|
|
|
+ $output['scene'] = 'friends';
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- $output['member_info'] = $minfo->filter();
|
|
|
- $output['is_friend'] = $isfriend;
|
|
|
|
|
|
- return self::outsuccess($output,"member/index",'wap');
|
|
|
+ $minfo = new member_info($idolid);
|
|
|
+ $output['member_info'] = $minfo->filter();
|
|
|
+ $output['is_friend'] = $isfriend;
|
|
|
+
|
|
|
+ return self::outsuccess($output,"member/index",'wap');
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception $ex)
|
|
|
+ {
|
|
|
+ Log::record(__METHOD__ . " {$ex->getMessage()}",Log::ERR);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -111,7 +123,7 @@ class user_indexControl extends mobileHomeControl
|
|
|
if(!session_helper::logined()) {
|
|
|
return self::outerr(errcode::ErrUnLogin);
|
|
|
}
|
|
|
- $idolid = $_GET['member_id'];
|
|
|
+ $idolid = intval($_GET['member_id']);
|
|
|
if($idolid <= 0) {
|
|
|
return self::outerr(errcode::ErrParamter);
|
|
|
}
|
|
@@ -156,7 +168,7 @@ class user_indexControl extends mobileHomeControl
|
|
|
}
|
|
|
|
|
|
$msg = json_decode($item['orgmsg'],true);
|
|
|
- $idolid = $msg['from']['userid'];
|
|
|
+ $idolid = intval($msg['from']['userid']);
|
|
|
if($idolid <= 0) {
|
|
|
return self::outerr(errcode::ErrParamter);
|
|
|
}
|
|
@@ -176,7 +188,7 @@ class user_indexControl extends mobileHomeControl
|
|
|
}
|
|
|
|
|
|
$msg = json_decode($item['orgmsg'],true);
|
|
|
- $idolid = $msg['from']['userid'];
|
|
|
+ $idolid = intval($msg['from']['userid']);
|
|
|
if($idolid <= 0) {
|
|
|
return self::outerr(errcode::ErrParamter);
|
|
|
}
|
|
@@ -184,75 +196,3 @@ class user_indexControl extends mobileHomeControl
|
|
|
return $this->open_page($idolid,['from_type' => '来自于好友申请','scene' => 'applyer','note' => $msg['note']]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-class tpl_member
|
|
|
-{
|
|
|
- private $mOutput;
|
|
|
- private $mInfo;
|
|
|
- private $mIsFriend;
|
|
|
- private $mPred;
|
|
|
- public function __construct($output)
|
|
|
- {
|
|
|
- $this->mOutput = $output;
|
|
|
- $this->mInfo = $this->mOutput['info'];
|
|
|
- $this->mIsFriend = $this->mOutput['is_friend'];
|
|
|
- $userid = $this->mInfo->member_id();
|
|
|
- $this->mPred = new bonus\account($userid);
|
|
|
- }
|
|
|
-
|
|
|
- public function output_group()
|
|
|
- {
|
|
|
- $amount = $this->mPred->total_bonus();
|
|
|
- $amount = intval($amount * 100 + 0.5) / 100;
|
|
|
- $discount = $this->mInfo->discount_self();
|
|
|
- $discount = intval($discount * 100 + 0.5) / 100;
|
|
|
-
|
|
|
- $result = "<div class=\"cell\">
|
|
|
- <span class=\"cell_label\">红包余额</span><span class=\"cell_content\"><span class=\"letter_pro\">$amount</span>元</span>
|
|
|
- </div>
|
|
|
- <div class=\"cell\">
|
|
|
- <span class=\"cell_label\">累计节省</span><span class=\"cell_content\"><span class=\"letter_pro\">$discount</span>元</span>
|
|
|
- </div>";
|
|
|
-
|
|
|
- if(!session_helper::isapp()) {
|
|
|
- $from = '<div class="cell">
|
|
|
- <span class="cell_label">信息来源</span><span class="cell_content">来自扫一扫</span>
|
|
|
- </div>';
|
|
|
- $result .= $from;
|
|
|
- }
|
|
|
- return $result;
|
|
|
- }
|
|
|
-
|
|
|
- public function output_btn()
|
|
|
- {
|
|
|
- $is_friend = $this->mOutput['is_friend'];
|
|
|
- if(!session_helper::isapp())
|
|
|
- {
|
|
|
-
|
|
|
- $result = '<div class="submit">';
|
|
|
- if($is_friend) {
|
|
|
- $result .= '<p class="cell_label">你已经是他的粉丝了</p>';
|
|
|
- } else {
|
|
|
- $result .= '<button type="button" id="btn_add_friend" class="add_friend_btn">关注</button>';
|
|
|
- }
|
|
|
- $result .= '</div>';
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- $result = '<div class="submit">
|
|
|
- <button type="button" id="btn_thief_bonus" class="add_friend_btn">偷一点</button>
|
|
|
- </div>
|
|
|
- <div class="submit">
|
|
|
- <button type="button" id="btn_send_bonus" class="send_bonus_btn">发红包</button>
|
|
|
- </div>';
|
|
|
-
|
|
|
- if(!$is_friend) {
|
|
|
- $result .= '<div class="submit">';
|
|
|
- $result .= '<button type="button" id="btn_add_friend" class="add_friend_btn">关注</button>';
|
|
|
- $result .= '</div>';
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $result;
|
|
|
- }
|
|
|
-}
|