alias('p'); if (isset($where['store_name']) && $where['store_name'] != '') { $model = $model->where('p.live_title|p.stream_name', 'LIKE', "%$where[store_name]%"); } if (isset($where['mer_id']) && $where['mer_id']) { $model = $model->where('p.mer_id', 'in', $where['mer_id']); } if (isset($where['institution_id']) && $where['institution_id']) { $model = $model->where('p.institution_id', 'in', $where['institution_id']); } if (isset($where['order']) && $where['order'] != '') { $model = $model->order(self::setOrder($where['order'])); } else { $model = $model->order('p.add_time DESC'); } $model = $model->join('LiveStudio l', 'p.live_id=l.id'); return $model; } /* * 获取直播审核列表 * @param $where array * @return array * */ public static function liveExamineList($where) { $model = self::getModelExamine($where)->field('p.*'); $model = $model->page((int)$where['page'], (int)$where['limit']); $data = ($data = $model->select()) && count($data) ? $data->toArray() : []; foreach ($data as $key => &$volue) { $volue['live_strar_time'] = date('Y-m-d H:i:s', $volue['live_strar_time']); $volue['live_end_time'] = date('Y-m-d H:i:s', $volue['live_end_time']); $volue['fail_time'] = date('Y-m-d H:i:s', $volue['fail_time']); } $count = self::getModelExamine($where)->count(); return compact('count', 'data'); } }