当前位置: 首页>>代码示例>>PHP>>正文


PHP Post::findAll方法代码示例

本文整理汇总了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;
 }
开发者ID:betephp,项目名称:betephp,代码行数:9,代码来源:SiteController.php

示例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;
     }
 }
开发者ID:JiltImageBoard,项目名称:jilt-backend,代码行数:18,代码来源:Cleanup.php

示例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);
 }
开发者ID:amal-khaled,项目名称:Find-Me-Application,代码行数:53,代码来源:PostController.php


注:本文中的app\models\Post::findAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。