39 lines
980 B
PHP
39 lines
980 B
PHP
<?php
|
|
|
|
namespace app\adminapi\lists\app;
|
|
|
|
use app\adminapi\lists\BaseAdminDataLists;
|
|
use app\common\lists\ListsSearchInterface;
|
|
use app\common\model\app\AppVersion;
|
|
|
|
/**
|
|
* APP 版本列表
|
|
* Class AppVersionLists
|
|
* @package app\adminapi\lists\app
|
|
*/
|
|
class AppVersionLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
{
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'%like%' => ['version_name', 'title'],
|
|
'=' => ['platform', 'package_type', 'update_type', 'status'],
|
|
];
|
|
}
|
|
|
|
public function lists(): array
|
|
{
|
|
return AppVersion::where($this->searchWhere)
|
|
->append(['platform_text', 'package_type_text', 'update_type_text'])
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order(['id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
}
|
|
|
|
public function count(): int
|
|
{
|
|
return AppVersion::where($this->searchWhere)->count();
|
|
}
|
|
}
|