You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
984 B
28 lines
984 B
<?php
|
|
namespace app\home\service;
|
|
|
|
use app\model\VideoOnDemandModel;
|
|
|
|
class VideoService extends BaseHomeService
|
|
{
|
|
public function getVideoOnDemandList($param): array
|
|
{
|
|
try {
|
|
if (empty($param['page']) || !is_numeric($param['page'])) {
|
|
return $this->toData('1', '参错错误');
|
|
}
|
|
$list = VideoOnDemandModel::where(['state'=>1])->order('sort', 'desc')->paginate([
|
|
'list_rows' => 15,
|
|
'page' => $param['page'],
|
|
]);
|
|
return $this->toData('0', 'Successful', [
|
|
'list' => $list->items(), // 当前页的数据
|
|
'page' => $list->currentPage(), // 当前页码
|
|
'total' => $list->total(), // 总记录数
|
|
'last_page' => $list->lastPage(), // 最后一页页码
|
|
]);
|
|
} catch (\Exception $exception) {
|
|
return $this->toData('100500', 'The system is busy.', []);
|
|
}
|
|
}
|
|
}
|