/** * Displays homepage. * * @return mixed */ public function actionIndex() { $info = ZCommonSessionFun::get_user_session(); ZCommonFun::print_r_debug($info); exit; return $this->render('index'); }
/** * 初始化 * @see \yii\base\Object::init() */ public function init() { parent::init(); $sessionUser = ZCommonSessionFun::get_user_session(); //没有设置用户信息 if (ZCommonSessionFun::get_user_id() > 0 && !isset($sessionUser['is_set_profile'])) { $sessionUser['is_set_profile'] = true; $model_UserProfile = new UserProfile(); $condition['uid'] = ZCommonSessionFun::get_user_id(); if ($model_UserProfile = $model_UserProfile->findOne($condition)) { $sessionUser['head_image'] = $model_UserProfile->getHeadImage0(); $sessionUser['nickname'] = $model_UserProfile->getNickname0(); $sessionUser['intro'] = $model_UserProfile->getIntro0(); ZCommonSessionFun::set_user_session($sessionUser); } } }
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; use common\z\ZController; use common\models\UserProfile; /* @var $model common\models\Survey */ use common\z\ZCommonSessionFun; use common\z\ZCommonFun; use common\z\Constellation; $sessionUser = ZCommonSessionFun::get_user_session(); $sessionUser_year = empty($sessionUser['profile']['birthday']) ? '' : date('Y', strtotime($sessionUser['profile']['birthday'])); $sessionUser_constellation = empty($sessionUser['profile']['birthday']) ? '' : Constellation::getDateToConstellation(date('Y', strtotime($sessionUser['profile']['birthday']))); $sessionUser_constellation_key = isset($sessionUser_constellation['key']) ? $sessionUser_constellation['key'] : ''; // ZCommonFun::print_r_debug($sessionUser_constellation); // ZCommonFun::print_r_debug($sessionUser); $sort = 1; $search = ''; $op_name = '最新'; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes"> <meta name="keywords" content="<?php echo ZController::$keywords; ?> " /> <meta name="description" content="<?php
<?php use yii\helpers\Html; use yii\grid\GridView; use common\z\ZCommonFun; use common\models\Survey; use common\z\ZCommonSessionFun; use common\models\User; /* @var $this yii\web\View */ /* @var $searchModel common\models\SurverySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $row common\models\Survey */ $this->title = '我测过的'; $login_user_showNickname = User::getUidShowName(ZCommonSessionFun::get_user_id()); $this->title = $login_user_showNickname . '的个人主页'; $this->params['breadcrumbs'][] = $this->title; echo $this->renderFile(__DIR__ . '/../layouts/head.php'); ?> <script type="text/javascript" src="./bag-test/js/jquery-2.1.0.min.js"></script> <div id="main_body"> <?php echo $this->renderFile(__DIR__ . '/../layouts/head-top.php'); ?> <section class="s_moreread"> <?php echo $this->renderFile(__DIR__ . '/../layouts/header-user.php');
/** * 推荐 * * @return \yii\web\Response */ public function actionRecommend($id, $op) { $this->layout = false; $model = Survey::findOne($id); if (ZCommonSessionFun::get_user_id() < 1) { ZCommonFun::output_json(null, -1, '请登录'); } if (ZCommonSessionFun::get_role() != 1) { ZCommonFun::output_json(null, 2, '管理员才能操作'); } // 没有找到 if (!$model) { ZCommonFun::output_json(null, 1, '测试不存在'); $model = new Survey(); } // 推荐 $model->is_top = $op == 1 ? $_SERVER['REQUEST_TIME'] : 0; if ($model->save()) { ZCommonFun::output_json(null, 0, '操作成功'); } ZCommonFun::output_json(null, -2, '操作失败'); }
/** * 获取我创建测得测试数量 */ public function getMySurveyCount($uid = 0) { $uid = $uid > 0 ? $uid : ZCommonSessionFun::get_user_id(); if ($uid < 1) { return 0; } $count = $this->find()->where(['uid' => $uid])->count(); $count ? null : ($count = 0); return $count; }
/** * 发布评论 */ public function actionAdd() { $id = Yii::$app->request->get('id', 0); $id = $id ? (int) $id : 0; $to_uid = Yii::$app->request->get('tid', 0); $to_uid = $to_uid ? (int) $to_uid : 0; $uid = ZCommonSessionFun::get_user_id(); $content = Yii::$app->request->get('content', ''); // if ($id < 1) // ZCommonFun::output_json(null, 1, '页面不存在'); /* * if($to_uid < 1 ) * ZCommonFun::output_json(null, 1, '页面不存在3'); */ if (empty($content)) { ZCommonFun::output_json(null, 2, '评论内容不能为空'); } if ($uid < 1) { ZCommonFun::output_json(null, -1, '请登录'); } if ($to_uid == $uid) { ZCommonFun::output_json(null, 3, '私信不能发给自己'); } $model_Message = new Message(); $model_Message->from_uid = $uid; $model_Message->to_uid = $to_uid; $model_Message->table = self::$messageTable; $model_Message->table_id = $id; $model_Message->add_time = NOW_TIME_YmdHis; $model_Message->content = $content; $model_Message->is_read = 0; $model_Message->parent_id = 0; $model_Message->title = ''; $model_Message->group_id = $uid . $to_uid; $model_Message->status = 0; // save success if ($model_Message->save()) { // $model_AnswerSurveyResulte = new AnswerSurveyResulte(); // $model_AnswerSurveyResulte->setcomment_count($model_Message->table_id); ZCommonFun::output_json(null, 0, '评论成功'); } else { ZCommonFun::output_json($model_Message->errors, -2, '评论失败'); } }
/** * 绑定,注册 * @return \yii\base\string */ public function actionBinding() { $LoginRedirect = new \LoginRedirectYii2(); $gourl = $LoginRedirect->getFirstVisitUrl(); $gourl = $gourl ? $gourl : 'survey/my'; $this->layout = false; $bind = ZCommonSessionFun::get_session('bind'); $bind_info = ZCommonSessionFun::get_session('bind_info'); // ZCommonFun::print_r_debug($gourl); // ZCommonFun::print_r_debug($bind); // ZCommonFun::print_r_debug($bind_info); // exit; if (ZCommonSessionFun::get_user_id() > 0 && $bind && isset($bind_info['openid'])) { $model_User = new User(); $return = $model_User->userBind('', '', ZCommonSessionFun::get_user_id(), $bind_info['openid'], $bind, $bind_info['nickname'], $bind_info['headimgurl'], false); return $this->redirect(['user-profile/bind-list']); } if ($bind && isset($bind_info['openid'])) { $model_OauthBind = new OauthBind(); $condition['openid'] = $bind_info['openid']; $condition['type'] = $bind; $model_OauthBind = $model_OauthBind->findOne($condition); if ($model_OauthBind) { $model = new User(); $condition = null; $condition['uid'] = $model_OauthBind->uid; $model = $model->findOne($condition); if ($model) { $userInfo = $model->attributes; isset($userInfo['role']) ? null : ($userInfo['role'] = 0); //角色 $userInfo['openidInfo'] = null; //第三方登录信息 if (isset($model->userProfile)) { $userInfo['profile'] = $model->userProfile->attributes; $userInfo['nickname'] = $model->userProfile->nickname; $userInfo['head_image'] = $model->userProfile->head_image; $userInfo['intro'] = $model->userProfile->intro; } ZCommonSessionFun::set_user_session($userInfo); return $this->redirect([$gourl]); } } } $model = new User(); return $this->render('binding', ['model' => $model]); }
</tr> </table> </div> <section class="s_reg s_login"> <div class="notice" title="太好了,完成最后一步吧^o^~"> </div> <?php $form = ActiveForm::begin(); ?> <div class="input-wrap"> <div class="form-group field-userprofile-nickname"> <label class="control-label" for="userprofile-nickname">账号</label> <?php $user_info2 = ZCommonSessionFun::get_login_type(); if ($user_info2['is_bind_user'] == 1) { ?> <a class="bind-row bind-exists">已注册</a> <?php } else { ?> <a class="bind-row" href="<?php echo Yii::$app->urlManager->createUrl(['user-profile/bind-account']); ?> ">未注册</a> <?php } ?> </div> </div>
width: auto; color: #ff7585; min-width: 30px; right: 10px; top: 30px; padding: 0 6px; border: 1px solid; border-radius: 3px; } </style> <script src="./js/concern.js"></script> <?php use common\z\ZCommonSessionFun; use common\z\ZCommonFun; use common\models\UsersFriends; $login_uid = ZCommonSessionFun::get_user_id(); $concern_status = 0; if ($login_uid < 1) { $concern_status = 0; } else { $model_UsersFriends = new UsersFriends(); $concern_status = $model_UsersFriends->get_user_each_concern($login_uid, $model_Users->uid); } $concer_url = ''; $concer_text = ''; switch ($concern_status) { case 1: $concer_url = Yii::$app->urlManager->createUrl(['my/concern', 'fuid' => $model_Users->uid]); $concer_text = '已相互关注'; break; case 2:
/** * 分数型测试结果保存 * @param unknown $post * @param unknown $condition * @param unknown $id */ public function step4_2SaveResulteCondition2($post, $condition, $id) { $post_data = []; $url = $error = ''; if (isset($post['name'][0])) { foreach ($post['name'] as $key => $name) { $value = isset($post['value'][$key]) ? $post['value'][$key] : ''; $intro = isset($post['intro'][$key]) ? $post['intro'][$key] : ''; $min = isset($post['score-min'][$key]) ? $post['score-min'][$key] : 1; $max = isset($post['score-max'][$key]) ? $post['score-max'][$key] : 1; $temp = $min > $max ? $min : $max; if ($min > $max) { $temp = $min; $min = $max; $max = $temp; } if ($max > 0 && $min > 0 && !empty($value) && isset($name[0])) { $post_data[$key]['name'] = $value; $post_data[$key]['value'] = $value; $post_data[$key]['intro'] = $intro; $post_data[$key]['sr-id'] = isset($post['sr-id'][$key]) ? $post['sr-id'][$key] : null; $post_data[$key]['min'] = $min; $post_data[$key]['max'] = $max; } } // ZCommonFun::print_r_debug($post_data); // ZCommonFun::print_r_debug($post); // exit(); //有结果 if ($post_data) { //保存结果 $transaction = Yii::$app->db->beginTransaction(); //删除结果 $deleteSurveyResulte = new SurveyResulte(); $deleteAll = $deleteSurveyResulte->getAll($id); isset($deleteAll[0]) ? null : ($deleteAll = []); $sr_ids = ZCommonFun::listData($deleteAll, 'sr_id', 'sr_id'); $save = 0; try { foreach ($post_data as $key => $row) { if (isset($row['sr-id']) && $row['sr-id'] > 0) { $row_SurveyResulte = SurveyResulte::findOne($row['sr-id']); if ($row_SurveyResulte) { //结果存在,就不删除 unset($sr_ids[$row['sr-id']]); if ($row_SurveyResulte->s_id != $id) { continue; } $save++; } else { $row_SurveyResulte = new SurveyResulte(); } } else { $row_SurveyResulte = new SurveyResulte(); } $row_SurveyResulte->score_max = $row['max']; $row_SurveyResulte->score_min = $row['min']; $row_SurveyResulte->name = $row['name']; $row_SurveyResulte->value = $row['value']; $row_SurveyResulte->intro = $row['intro']; $row_SurveyResulte->value = $row['value']; $row_SurveyResulte->value = $row['value']; $row_SurveyResulte->uid = ZCommonSessionFun::get_user_id(); $row_SurveyResulte->s_id = $id; $row_SurveyResulte->save() ? $save++ : null; } if ($save > 0) { $condition = null; if (count($sr_ids) > 0) { $condition['sr_id'] = $sr_ids; $condition['s_id'] = $id; //删除所有结果 SurveyResulte::deleteAll($condition); } $transaction->commit(); $url = ['my']; } // ZCommonFun::print_r_debug($sr_ids); // ZCommonFun::print_r_debug($post_data); // exit; $url = ['my']; } catch (\Exception $e) { // ZCommonFun::print_r_debug($e); $transaction->rollBack(); } } } return $url; }
/** * 授权回调地址 */ public function actionWeiXinCallback() { $zhao_uid = ZCommonSessionFun::get_user_id(); $zhao_uid = $zhao_uid > 0 ? $zhao_uid : ''; $o_WeiXin = new WeiXin(); // echo '<pre>'; if (isset($_GET['code'])) { $code = $o_WeiXin->oautch_get_code(); if ($code) { $data = $o_WeiXin->oautch_access_token($o_WeiXin->APPID, $o_WeiXin->SECRETS, $code, false); //设置access_token if (isset($data->openid) && $data->openid) { $basic_access_token = Yii::$app->cache->get('basic_access_token'); //if( !$basic_access_token ){ //$basic_access_token = $o_WeiXin->oau(null,null,false); //echo $basic_access_token,'token','<br/>'; // print_r($data); // print_r($basic_access_token); // exit; // print_r($basic_access_token); //Yii::$app->cache->set('basic_access_token', $basic_access_token,7000); //} // echo $basic_access_token,'token2222222','<br/>'; $user_info = $o_WeiXin->user_info($data->access_token, $data->openid, null, true); if (!isset($user_info->nickname)) { echo '<br/>', 'userinfo'; print_r($user_info); exit; } $openid = $data->openid; $bind_info['openid'] = $openid; $bind_info['nickname'] = $user_info->nickname; $bind_info['headimgurl'] = $user_info->headimgurl; ZCommonSessionFun::set_session('bind_info', $bind_info); ZCommonSessionFun::set_session('bind', OauthBind::typeWeiXin); //微信登陆类型 if (intval($zhao_uid) > 0) { return $this->redirect($this->bind_url); } else { ZCommonSessionFun::set_login_type(OauthBind::typeWeiXin); } return $this->redirect($this->bind_url); /* $model_User = new User(); $return = $model_User->userBind('', '', $zhao_uid, $openid, OauthBind::typeWeiXin, $user_info->nickname , $user_info->headimgurl ,true); //绑定成功或者已经绑定 if($return===0 || $return===1){ $user = $model_User->operationData['user']->attributes; $user['nickname'] = $model_User->operationData['user_profile']->nickname; $user['head_image'] = $model_User->operationData['user_profile']->head_image; $user['openid'] = $openid; ZCommonSessionFun::set_user_session($user); // ZCommonFun::print_r_debug($user); // ZCommonFun::print_r_debug( $model_User->operationData ); // exit; //微信登陆类型 if(intval($zhao_uid)>0){ return $this->redirect($this->bind_url); }else{ ZCommonSessionFun::set_login_type(OauthBind::typeWeiXin); } return $this->redirect([ZCommonSessionFun::urlMyStr]); } */ } else { // print_r( $data ); return $this->redirect($this->bind_url); } // } echo $code, 'code'; print_r($data); } }
echo $url_logout; ?> ">退出</a> </div> <div > 测过<sapn class="common-color"><?php echo UserProfile::getTestingCount(ZCommonSessionFun::get_user_id()); ?> </sapn>次 </div> <div onclick="javascript:window.top.document.location='<?php echo Yii::$app->urlManager->createUrl(['my/uid-fans', 'uid' => $sessionUser['uid']]); ?> '"> 粉丝<sapn class="common-color"><?php echo UsersFriends::get_concern_count(ZCommonSessionFun::get_user_id()); ?> </sapn>人 </div> </td> </tr> </table> </div> <?php ?> <nav class="user-menu"> <a class="<?php echo $header_user_name_select0; ?> " href="<?php echo $url_my_test;
<?php use yii\helpers\Html; use yii\grid\GridView; use common\z\ZCommonFun; use common\models\Survey; use common\z\ZCommonSessionFun; use common\models\User; /* @var $this yii\web\View */ /* @var $searchModel common\models\SurverySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $row common\models\Survey */ $login_user_showNickname = User::getUidShowName(ZCommonSessionFun::get_user_id()); $ta_user_showNickname = User::getTaUidShowName($uid); $User = User::findOne(ZCommonSessionFun::get_user_id()); $login_head_image = $User ? $User->getTaShowHead_image() : User::getDefaultHead_image(); $ta_User = User::findOne($uid); $ta_head_image = $ta_User ? $ta_User->getTaShowHead_image() : User::getDefaultHead_image(); $this->title = $ta_user_showNickname . '与' . $login_user_showNickname; $this->params['breadcrumbs'][] = $this->title; echo $this->renderFile(__DIR__ . '/../layouts/head.php'); ?> <style> .s_moreread{ margin-bottom: 220px; position: relative; } </style> <script type="text/javascript" src="./bag-test/js/jquery-2.1.0.min.js"></script> <div id="main_body">
/** * 注册 */ public function register() { $this->created = NOW_TIME_YmdHis; $this->flag = NOW_TIME_STAMP; if ($this->validate()) { $post_pass = $this->pass; $this->is_bind_user = 1; if ($this->save()) { $this->pass = ZCommonFun::getPass($post_pass); $this->save(); $userInfo = $this->attributes; isset($userInfo['role']) ? null : ($userInfo['role'] = 0); //角色 $userInfo['openidInfo'] = null; //第三方登录信息 ZCommonSessionFun::set_user_session($userInfo); // ZCommonFun::print_r_debug($this); // exit; return true; } return false; } return false; }
<?php use common\z\ZCommonSessionFun; $role = ZCommonSessionFun::get_role(); $data['data'] = ''; if ($pagination->page < $pagination->pageCount) { $data['data'] = ''; } foreach ($a_models as $key => $row) { if ($row->tax == 1) { $url = Yii::$app->urlManager->createUrl(['answer/step1', 'id' => $row->id]); } else { $url = Yii::$app->urlManager->createUrl(['answer/step2-answer2', 'id' => $row->id]); } $image = common\models\Survey::getImageUrl($row); $is_top_text = ''; $is_top_url = ''; $op0 = Yii::$app->urlManager->createUrl(['survey/recommend', 'id' => $row->id, 'op' => 0]); $op1 = Yii::$app->urlManager->createUrl(['survey/recommend', 'id' => $row->id, 'op' => 1]); $is_top = 0; if ($row->is_top > 0) { $is_top_text = '取消推荐'; $is_top = 0; } else { $is_top_text = '推荐'; $is_top = 1; } $str_recommend = ''; if ($role == 1) { $str_recommend = <<<str \t\t\t\t<a
/** * 奇趣测试回答 */ public function actionStep1($id) { $this->layout = false; $model = Survey::findOne($id); if (!$model) { //没找到 $model = new Survey(); } if ($model->is_publish < 1) { $this->popupMessage($model->title . '未发布,不能测试'); exit; } $data = $model->FindAllQuestionsOptions($id); $q = new Question(); $posts = Yii::$app->request->post(); //查找answer操作 $aid = Yii::$app->request->get('aid', 0); $aid = (int) $aid; $result = null; if (isset($posts['name']) && !empty($posts['name'])) { if (isset($posts['name'])) { $model->save(); $model_Answer = new Answer(); $model_Answer->table_id = $id; $model_Answer->value = $posts['name']; $model_Answer->save(); } else { $posts['name'] = $model_Answer->value; } // ZCommonFun::print_r_debug($posts['name']); // ZCommonFun::print_r_debug($model_Answer); // exit; $name = isset($posts['name']) ? $posts['name'] : ''; $year = isset($posts['birth']['year']) ? $posts['birth']['year'] : 2015; $month = isset($posts['birth']['month']) ? $posts['birth']['month'] : '01'; $day = isset($posts['birth']['day']) ? $posts['birth']['day'] : '01'; $constellation = isset($posts['constellation']) ? intval($posts['constellation']) : 0; $constellation = $constellation > 0 && $constellation < 13 ? $constellation : 0; $birth = $year . '-' . $month . '-' . $day; $birth = date('Y-m-d', strtotime($birth)); $model_SurveyResulte = new SurveyResulte(); //计算测试结果 $result = $model_SurveyResulte->getStep1Result($id, $name, $birth); // $model->answer_count = $model->randCount($model->answer_count); if ($result) { $model_AnswerUser = new AnswerUser(); $model_AnswerUser->uid = ZCommonSessionFun::get_user_id(); $model_AnswerUser->sid = $id; $model_AnswerUser->answer_name = $name; $model_AnswerUser->answer_age = $birth; $model_AnswerUser->constellation = $constellation; //直接跳转答案 if ($result) { //保存回答者结果,防止用户更改数据导致结果丢失 $mode_AnswerSurveyResulte = new AnswerSurveyResulte(); $mode_AnswerSurveyResulte->attributes = $result->attributes; $mode_AnswerSurveyResulte->save(); $model_AnswerUser->table = 'answer_survey_resulte'; $model_AnswerUser->table_id = $mode_AnswerSurveyResulte->answer_sr_id; } $model_AnswerUser->ip = self::getUserIP(); if ($model_AnswerUser->save()) { //设置测试数量 $model->setAnswerCount($id); $model_UserProfile = new UserProfile(); $model_UserProfile->setTestCount($model_AnswerUser->uid); return $this->redirect(['resulte', 'au_id' => $model_AnswerUser->au_id]); } } } $model_Users = null; $model_UsersProfile = null; if ($model->uid) { $zhao_condition['uid'] = $model->uid; $model_Users = User::findOne($zhao_condition); $model_UsersProfile = UserProfile::findOne($zhao_condition); } !$model_Users ? $model_Users = new User() : ''; !$model_UsersProfile ? $model_UsersProfile = new UserProfile() : ''; $model_UsersProfile->uid = $model->uid; $model_SurveyOperation = new SurveyOperation(); $models_SurveyOperation = $model_SurveyOperation->getIsTop(); return $this->render('answer2', ['models_SurveyOperation' => $models_SurveyOperation, 'data' => $data, 'model' => $model, 'result' => $result, 'posts' => $posts, 'image' => Survey::getImageUrl($model), 'model_Users' => $model_Users, 'model_UsersProfile' => $model_UsersProfile, 'randSurvey' => $this->getRandSurvey()]); // return $this->render('answer',[ // 'data'=>$data, // 'model'=>$model, // 'result'=>$result, // 'posts'=>$posts, // 'image'=>Survey::getImageUrl($model), // 'model_Users'=>$model_Users, // 'model_UsersProfile'=>$model_UsersProfile, // ]); }
/** * 指定用户关注的人 * * @param integer $uid */ public function actionUidConcern($uid) { $login_uid = ZCommonSessionFun::get_user_id(); $this->layout = false; $uid = intval($uid); $this->view->title = User::getUidShowName($uid) . '关注的人'; $model = new UsersFriends(); $condition['uid'] = $uid; $data = $model->getList($condition, null, $this->pageSize); if (isset($_GET['ajax'])) { $status = 0; $html = ''; if (isset($_GET[$data['pagination']->pageParam]) && $data['pagination']->pageCount < $_GET[$data['pagination']->pageParam]) { $data['models'] = []; } $my_fans_uids = ZCommonFun::listData($data['models'], 'fuid', 'fuid'); $concer_data = []; if (count($my_fans_uids) > 0) { $my_fans_uids_str = implode(',', $my_fans_uids); $sql = <<<str select uf.uid uf_uid,uf.fuid fans /*我关注的人*/,( select count(id) from users_friends where uid=uf_uid and fuid={$login_uid} ) fans_is_concern_ta /*uf.uid关注了他 */ ,( select count(id) from users_friends where uid={$login_uid} and fuid=uf_uid )ta_is_concern_fans /* 他关注了uf.uid */ ,up.* from users_friends uf left join user_profile up on up.uid=uf.uid where uf.uid in({$my_fans_uids_str} ) group by uf.uid str; $query = new Query(); $concer_data = $query->createCommand()->setSql($sql)->queryAll(); } // ZCommonFun::print_r_debug($concer_data); // exit; // ZCommonFun::print_r_debug($data); foreach ($data['models'] as $key => $row) { $ta_url = Yii::$app->urlManager->createUrl(['my/personal-page', 'uid' => $row->fuid]); $ta_nickname = User::getDefaultTaNickname(); $ta_image = User::getDefaultHead_image(); $ta_intro = User::getDefaultTaIntro(); $concer_text = '关注'; $is_find = false; foreach ($concer_data as $key2 => $row2) { if ($row->fuid == $row2['uf_uid']) { !empty($row2['nickname']) ? $ta_nickname = $row2['nickname'] : null; !empty($row2['head_image']) ? $ta_image = $row2['head_image'] : null; !empty($row2['intro']) ? $ta_intro = $row2['intro'] : null; if ($row2['fans_is_concern_ta'] && $row2['ta_is_concern_fans']) { $url = ''; $concer_text = '相互关注'; } else { if ($row2['ta_is_concern_fans']) { $url = ''; $concer_text = '已关注'; } else { $url = Yii::$app->urlManager->createUrl(['my/concern', 'fuid' => $row->fuid]); } } $is_find = true; break; } } if (!$is_find) { $url = Yii::$app->urlManager->createUrl(['my/concern', 'fuid' => $row->fuid]); } $html .= <<<str <ul class="list" id="answer-view" style="margin:0;"> <li class="diy-item"><a \t\t\t\t\thref="{$ta_url}" \t\t\t\t\ttarget="_blank"> \t\t\t\t\t\t<figure class="cover"> \t\t\t\t\t\t\t<img src="{$ta_image}" \t\t\t\t\t\t\t\tclass="tuijian-img"> \t\t\t\t\t\t</figure> \t\t\t\t\t\t<div class="diy-meta"> \t\t\t\t<div class="title mui-ellipsis">{$ta_nickname}</div> \t\t\t\t<span class="iconfont icon-start-filled5"></span> \t\t\t\t<div class="desc mui-ellipsis">{$ta_intro}</div> \t\t\t</div> \t\t\t\t</a> \t<a url="{$url}" class="play concern" onclick="concern(this)" data-ui="danger small icon-right">{$concer_text}<i class="iconfont icon-right"></i> \t</a> \t\t\t\t </li> </ul> str; } echo $html; exit; } return $this->render('fans', ['uid' => $uid, 'ajax_url' => Yii::$app->urlManager->createUrl(['my/uid-concern', 'uid' => $uid, 'page' => '#page#', 'ajax' => '1'])]); }
/** * 退出 */ public function actionLogout() { ZCommonSessionFun::set_user_session(null); return $this->redirect(['survey/index']); }