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

68 lines
1.4 KiB

<?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 ,$pageSize): \think\Paginator
{
// 假设从数据库查询数据
$query = self::order('sort', 'asc')->paginate($pageSize);
// 使用分页方法
return $query;
}
/**
* @notes:新增
* @param $data
* @return bool
*/
public function add($data): bool
{
$data['store_id'] = self::$storeId;
return $this->save($data);
}
/**
* @notes:删除
* @param array $IdentityId
* @return bool
* @author: wanghousheng
*/
public function remove(array $ids): bool
{
if (static::whereIn('id', $ids)->delete()) {
return true;
}
return false;
}
}