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.
27 lines
797 B
27 lines
797 B
<?php
|
|
|
|
namespace app\admin\model;
|
|
|
|
use app\common\model\TimeModel;
|
|
|
|
class LiveRoom extends TimeModel
|
|
{
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
protected $defaultSoftDelete = '0';
|
|
|
|
public static function getPageList($param = []): array
|
|
{
|
|
$page = $param['page'] ?? 1;
|
|
$limit = $param['limit'] ?? 10;
|
|
$where = [['status', '=', 1]];
|
|
if (isset($param['keyword'])) {
|
|
$where[] = ['room_id', 'like', '%'.$param['keyword'].'%'];
|
|
}
|
|
$field = 'id, room_id, anchor_information, link, create_time';
|
|
$order = 'id desc';
|
|
$count = self::where($where)->count();
|
|
$list = self::where($where)->field($field)->order($order)->page($page, $limit)->select();
|
|
return ['data' => $list, 'count' => $count];
|
|
}
|
|
}
|
|
|