erp_old/app/admin/lists/order/CartLists.php

65 lines
1.3 KiB
PHP
Raw Normal View History

2024-04-26 11:26:12 +08:00
<?php
namespace app\admin\lists\order;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\order\Cart;
use app\common\lists\ListsSearchInterface;
/**
* 购物车表列表
* Class CartLists
* @package app\admin\listsorder
*/
class CartLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2024/04/24 10:37
*/
public function setSearch(): array
{
return [
];
}
/**
* @notes 获取购物车表列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2024/04/24 10:37
*/
public function lists(): array
{
return Cart::where($this->searchWhere)
->field(['cart_id'])
->limit($this->limitOffset, $this->limitLength)
->order(['cart_id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取购物车表数量
* @return int
* @author likeadmin
* @date 2024/04/24 10:37
*/
public function count(): int
{
return Cart::where($this->searchWhere)->count();
}
}