update cms

This commit is contained in:
JaguarJack
2021-05-26 18:37:00 +08:00
parent d97b5f62ee
commit 9252c3d537
11 changed files with 268 additions and 1 deletions

View File

@@ -13,8 +13,11 @@
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\search\CommentsSearch;
class Comments extends BaseModel
{
use CommentsSearch;
// 表名
public $name = 'cms_comments';
// 数据库字段映射
@@ -43,4 +46,14 @@ class Comments extends BaseModel
// 软删除
'deleted_at',
);
public function getList()
{
return $this->catchJoin(Articles::class, 'id', 'article_id', ['title'])
->catchJoin(Users::class, 'id', 'user_id', ['username'])
->field($this->aliasField('*'))
->catchSearch()
->catchOrder()
->paginate();
}
}