65 lines
1.8 KiB
PHP
65 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace app\admin\lists\merchant;
|
|
|
|
|
|
use app\admin\lists\BaseAdminDataLists;
|
|
use app\common\model\merchant\Merchant;
|
|
use app\common\lists\ListsSearchInterface;
|
|
|
|
|
|
/**
|
|
* 商户列表列表
|
|
* Class MerchantLists
|
|
* @package app\admin\listsmerchant
|
|
*/
|
|
class MerchantLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 设置搜索条件
|
|
* @return \string[][]
|
|
* @author likeadmin
|
|
* @date 2024/04/23 16:35
|
|
*/
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'=' => ['category_id', 'type_id', 'mer_name', 'credit_buy', 'status', 'commission_rate', 'service_phone','service_user', 'mer_money', 'financial_bank', 'financial_wechat', 'financial_alipay'],
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取商户列表列表
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @author likeadmin
|
|
* @date 2024/04/23 16:35
|
|
*/
|
|
public function lists(): array
|
|
{
|
|
return Merchant::where($this->searchWhere)
|
|
->field(['mer_id', 'category_id', 'type_id', 'mer_name', 'credit_buy', 'settle_cycle', 'interest_rate', 'city_id', 'area_id', 'street_id', 'village_id', 'mer_address', 'mer_avatar', 'mark', 'commission_rate', 'service_phone','service_user', 'mer_money', 'financial_bank', 'financial_wechat', 'financial_alipay'])
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order(['mer_id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取商户列表数量
|
|
* @return int
|
|
* @author likeadmin
|
|
* @date 2024/04/23 16:35
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return Merchant::where($this->searchWhere)->count();
|
|
}
|
|
|
|
} |