Example #1
0
 public function ajaxModify()
 {
     $article = new Article();
     $user_model = new User();
     $result = $article->paginateArticles(array(), 10, 'id', 'desc');
     if (!$result->isEmpty()) {
         foreach ($result->items() as $item) {
             $user = $user_model->getUser(['id' => $item->Users_id], ['name']);
             $item->name = $user->name;
         }
     }
     return view('ajax/admin/modify', ["all" => $result])->renderSections();
 }
Example #2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create($id)
 {
     $model = new Article();
     $articles = $model->paginateArticles(["Portal_id" => $id], 5, 'id', 'desc');
     $model = new Portal();
     while ($hasParent[] = $model->getPortal(["id" => $id], ["parent", "name"])) {
         $current = current($hasParent);
         $id = $current->parent;
     }
     unset($hasParent[count($hasParent) - 1]);
     $hasParent = array_reverse($hasParent);
     return view("portal.index", ["all" => $articles, "hasParent" => $hasParent]);
 }
 public function testpage()
 {
     $tmp_model = new Article();
     $result = $tmp_model->paginateArticles(array(), 23);
     return view('test.article', ['all' => $result]);
 }