You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/app/common/model/successful.php

43 lines
913 B

6 months ago
<?php
declare (strict_types=1);
namespace app\common\model;
use cores\BaseModel;
/**
* 模型类:调货记录表
* Class Cart
* @package app\common\model
*/
class successful extends BaseModel
{
// 定义表名
protected $name = 'successful';
// 定义主键
protected $pk = 'id';
// 开启自动写入时间戳
protected $autoWriteTimestamp = true;
// 创建时间字段
protected $createTime = 'create_time';
// 更新时间字段
protected $updateTime = 'update_time';
/**
* 获取列表数据并分页
*
* @param array $param 查询参数
* @return \think\Paginator
*/
public function list($page): \think\Paginator
{
// 假设从数据库查询数据
$query = self::order('sort', 'desc')->select();
// 使用分页方法
return $query->paginate($page,10);
}
}