本文整理汇总了PHP中app\models\Post::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Post::findAll方法的具体用法?PHP Post::findAll怎么用?PHP Post::findAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Post
的用法示例。
在下文中一共展示了Post::findAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($request)
{
$this->renderType = 'smarty';
$name = $request->post('name');
$list = Post::findAll();
$list = Post::select()->where()->all();
$row = Post::select()->where(['id' => 1])->one();
return $list;
}
示例2: getPostDataIds
private static function getPostDataIds(array &$carry)
{
/**
* Find postDataIds owned by threads and posts (which owned by threads)
*/
foreach (Thread::findAll($carry['threadsIds']) as $thread) {
$carry['postDataIds'][] = $thread->postDataId;
foreach ($thread->posts as $post) {
$carry['postDataIds'][] = $post->postData->id;
}
}
/**
* Find postDataIds owned by posts
*/
foreach (Post::findAll($carry['postsIds']) as $post) {
$carry['postDataIds'][] = $post->postDataId;
}
}
示例3: actionGetfollowerpost
public function actionGetfollowerpost()
{
$check_post = 0;
$id = $_POST['id'];
$follow = new Follow();
$follow->studentID = $id;
$model = array();
$model = Follow::findAll(['studentID' => $id]);
$status = array();
$statuss = array();
if ($model == Null) {
$status["status"] = "faild";
$statuss["status"] = "null";
} else {
$status["status"] = "ok";
$statuss["status"] = "ok";
for ($j = 0; $j < sizeof($model); $j++) {
$status["follower"][$j] = $model[$j]->staffID;
}
$i = 0;
$m = 0;
$k = 0;
for ($i = 0; $i < sizeof($model); $i++) {
$staff_id = $model[$i]->staffID;
$posts = array();
$posts = Post::findAll(['owner' => $staff_id]);
if ($posts == Null) {
//$statuss["status"]="faild";
$check_post++;
} else {
$status["status"] = "ok";
$statuss["status"] = "ok";
for ($m = 0; $m < sizeof($posts); $m++) {
$name = "";
$statuss["content"][$k] = $posts[$m]->content;
//=$posts[$m] ->content;
$statuss["owner"][$k] = $posts[$m]->owner;
$name = StaffController::GetStaffName($statuss["owner"][$k]);
$statuss["name"][$k] = $name;
$statuss["time"][$k] = $posts[$m]->time;
$k++;
}
//$k += sizeof($posts);
}
}
}
if ($check_post == sizeof($model)) {
$statuss["post"] = "null";
} else {
$statuss["post"] = "full";
}
return json_encode($statuss);
}