Skip to content

Commit a90acd3

Browse files
committed
提交开发事例
1 parent f093c29 commit a90acd3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
2+
23
namespace app\http\controller;
34

45
use framework\Controller;
5-
use app\http\model\Home as HomeModel;
66

77
class Home extends Controller
88
{
9+
910
public function main()
1011
{
11-
$model = new HomeModel();
12-
return ['code' => 200, 'msg' => $model->find()->toArray()];
12+
$model = model('app/http/model/Home');
13+
return ['code' => 200, 'msg' => $model->select()->toArray()];
1314
}
1415

1516
}

src/application/http/model/Home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Home extends Model
88
{
99

10-
protected $field = ['id'];
10+
protected $field = ['id', 'title', 'c_id', 'post_time', 'up_time', 'is_on'];
1111

1212
protected $name = 'forum';
1313

0 commit comments

Comments
 (0)