where("title|url", "like", "%$where[title]%"); if ($where['start_time'] != '') $model = $model->where("create_time", ">", strtotime($where['start_time'] . " 00:00:00")); if ($where['end_time'] != '') $model = $model->where("create_time", "<", strtotime($where['end_time'] . " 23:59:59")); if ($where['status'] != '') $model = $model->where("status", $where['status']); $count = self::counts($model); if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'], (int)$where['limit']); $data = $model->select(); if ($data) $data = $data->toArray(); return compact('data', 'count'); } }