erp/app/api/lists/operation/OpurchaseGoodsOfferList.php
2024-04-29 16:36:12 +08:00

61 lines
1.4 KiB
PHP

<?php
namespace app\api\lists\operation;
use app\admin\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\opurchase\OpurchaseGoodsOffer;
/**
* 采购供应链商户报价列表
* Class OpurchaseclassLists
* @package app\api\operation
*/
class OpurchaseGoodsOfferList extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
*/
public function setSearch(): array
{
return [
];
}
/**
* @notes 获取采购供应链商户报价列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @date 2024/04/27 11:26
*/
public function lists(): array
{
$supplier_id=$this->request->userInfo['supplier']['id'];
if(!$supplier_id) return [];
return OpurchaseGoodsOffer::where($this->searchWhere)->where('supplier_id',$supplier_id)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取采购供应链商户报价数量
* @return int
* @date 2024/04/27 11:26
*/
public function count(): int
{
return OpurchaseGoodsOffer::where($this->searchWhere)->count();
}
}