12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- declare (strict_types=1);
- namespace app\dao\activity\live;
- use app\dao\BaseDao;
- use app\model\activity\live\LiveRoom;
- class LiveRoomDao extends BaseDao
- {
-
- protected function setModel(): string
- {
- return LiveRoom::class;
- }
-
- public function getList(array $where, string $field = '*', array $with = [], int $page = 0, int $limit = 0)
- {
- return $this->search($where)->field($field)->with($with)->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
- }
-
- public function validRoom($roomId)
- {
- return $this->getModel()->where('id', $roomId)->where('status', 'IN', [0, 2])->where('is_del', 0)->find();
- }
- public function getRooms(array $roomIds)
- {
- return $this->search(['room_id' => $roomIds])->column('live_status,id', 'room_id');
- }
- }
|