erp_old/app/api/lists/merchant/MerchantLists.php

62 lines
1.3 KiB
PHP
Raw Normal View History

2024-04-29 16:36:12 +08:00
<?php
namespace app\api\lists\merchant;
use app\admin\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\merchat\Merchant;
use app\common\model\opurchase\OpurchaseGoodsOffer;
/**
* 商户列表
* Class MerchantLists
* @package app\api\merchant
*/
class MerchantLists 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
{
return Merchant::where($this->searchWhere)
->field('mer_id,mer_name')
->limit($this->limitOffset, $this->limitLength)
->order(['mer_id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 商户数量
* @return int
* @date 2024/04/27 11:26
*/
public function count(): int
{
return OpurchaseGoodsOffer::where($this->searchWhere)->count();
}
}