Skip to content

Commit

Permalink
提交开发事例
Browse files Browse the repository at this point in the history
  • Loading branch information
liugene committed Dec 2, 2018
1 parent f093c29 commit a90acd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/application/http/controller/Home.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace app\http\controller;

use framework\Controller;
use app\http\model\Home as HomeModel;

class Home extends Controller
{

public function main()
{
$model = new HomeModel();
return ['code' => 200, 'msg' => $model->find()->toArray()];
$model = model('app/http/model/Home');
return ['code' => 200, 'msg' => $model->select()->toArray()];
}

}
2 changes: 1 addition & 1 deletion src/application/http/model/Home.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Home extends Model
{

protected $field = ['id'];
protected $field = ['id', 'title', 'c_id', 'post_time', 'up_time', 'is_on'];

protected $name = 'forum';

Expand Down

0 comments on commit a90acd3

Please sign in to comment.