38 lines
910 B
PHP
38 lines
910 B
PHP
<?php
|
|
|
|
namespace app\api\lists\sv;
|
|
|
|
use app\api\lists\BaseApiDataLists;
|
|
use app\common\lists\ListsSearchInterface;
|
|
use app\common\model\sv\SvCopywriting;
|
|
|
|
/**
|
|
* 文案列表
|
|
* Class SvCopywritingLists
|
|
* @package app\api\lists\sv
|
|
*/
|
|
class SvCopywritingLists extends BaseApiDataLists implements ListsSearchInterface
|
|
{
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'=' => ['user_id', 'status', 'type'],
|
|
// 其他搜索条件
|
|
];
|
|
}
|
|
|
|
public function lists(): array
|
|
{
|
|
$this->searchWhere[] = ['user_id', '=', $this->userId];
|
|
return SvCopywriting::where($this->searchWhere)
|
|
->order(['id' => 'desc'])
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->select()
|
|
->toArray();
|
|
}
|
|
|
|
public function count(): int
|
|
{
|
|
return SvCopywriting::where($this->searchWhere)->count();
|
|
}
|
|
} |