manghe/app/common/model/Danye.php
2025-04-06 17:26:08 +00:00

38 lines
852 B
PHP
Executable File

<?php
namespace app\common\model;
use app\common\model\Base;
use think\Model;
class Danye extends Base{
// 设置当前模型对应的完整数据表名称
protected $table = 'danye';
/**
* 获取列表
*/
public static function getList($where = [],$field='*',$order='',$pageSize = "15")
{
$list = self::where($where)
->field($field)
->order($order)
->paginate($pageSize);
$page = $list->render();
$data['list'] = $list->toArray()['data'];
$data['count']=$list->total();
$data['page']=$page;
return $data;
}
/**
* 获取单条数据
*/
public static function getInfo($where = [],$field = '*'){
$data = self::where($where)
->field($field)
->find();
return $data;
}
}