本文整理汇总了PHP中ActivityModel::getAdapter方法的典型用法代码示例。如果您正苦于以下问题:PHP ActivityModel::getAdapter方法的具体用法?PHP ActivityModel::getAdapter怎么用?PHP ActivityModel::getAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActivityModel
的用法示例。
在下文中一共展示了ActivityModel::getAdapter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: homeAction
public function homeAction()
{
// action body
// echo $_COOKIE["account"];
// print_r( $this->cookie);
$imgpath = $_SERVER['DOCUMENT_ROOT'] . "/WebOne/public/image/head/";
$id = $_SESSION["userinfo"][0][id];
// print_r($_SESSION["userinfo"][0]);
$userinfo = new userinfoModel();
$db = $userinfo->getAdapter();
$user = $db->query('SELECT * FROM userinfo where userid=?', $id)->fetchAll()[0];
$activitys = new ActivityModel();
$db1 = $activitys->getAdapter();
$hotactivity = $db1->query('select * from activity order by nums desc limit 0,1')->fetchAll()[0];
$questions = new QuestionModel();
$db2 = $questions->getAdapter();
$hotquestion = $db2->query('select * from question order by answernum desc limit 0,1')->fetchAll()[0];
if (file_exists($imgpath . $id . ".jpg")) {
$this->view->path = $baseUrl . "/WebOne/public/image/head/" . $id . ".jpg";
} else {
$this->view->path = $baseUrl . "/WebOne/public/image/initial.jpg";
}
$userid = $hotquestion[userid];
$Usertable = new UserModel();
$db3 = $Usertable->getAdapter();
$name = $db3->query('select name from User where id=?', $userid)->fetchAll()[0][name];
$this->view->user = $user;
$this->view->info = $_SESSION["userinfo"];
$this->view->activity = $hotactivity;
$this->view->question = $hotquestion;
$this->view->name = $name;
}
示例2: myactivityAction
public function myactivityAction()
{
$usertable = new UserModel();
$db1 = $usertable->getAdapter();
$uid = $_SESSION["userinfo"][0][id];
$user = $usertable->fetchRow($db1->quoteInto('id=?', $uid))->toArray();
$table = new User_ActivityModel();
$db2 = $table->getAdapter();
$activitytable = new ActivityModel();
$db3 = $activitytable->getAdapter();
//$where = $db2->quoteInto('userid = ? ', $uid);
//$flag0 = count($table->fetchAll($where) ->toArray()) ;
$result = $db3->query('SELECT activity.* FROM activity,userconactivity WHERE activity.id = userconactivity.activityid and userconactivity.userid =? order by activity.begin desc', $uid)->fetchAll();
$this->view->result = $result;
$this->view->type = $user['type'];
}