12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\manage\model;
- use think\Model;
- use think\Db;
- class TemplateModel extends Model {
- protected $table = 'templates';
- public function queryAll( $wheres, $page, $pageSize){
- $query = Db::view('templates', 'id, title, is_public, create_user, exam_class_id, impression, description, createdAt, parent_id');
- if (!empty($wheres)){
- $query->where($wheres);
- }
- return $query->page($page,$pageSize)->select();
- }
- public function queryAllCount($wheres, $page, $pageSize){
- $query = Db::view('templates', 'id, title, is_public, create_user, exam_class_id, impression, description, createdAt, parent_id');
- if (!empty($wheres)){
- $query->where($wheres);
- }
- return $query->count();
- }
- }
|