where('is_del', 0); if (isset($where['cid']) && $where['cid']) $model = $model->where('classes_id', $where['cid']); if (isset($where['title']) && $where['title'] != '') $model = $model->where('name|nickname|id', 'like', "%$where[title]%"); return $model; } /**学员列表 * @param $where */ public static function getStudentLists($where) { $data = self::setWhere($where)->page($where['page'], $where['limit'])->select(); foreach ($data as $key => &$value) { $value['title'] = Classes::where('id', $value['classes_id'])->value('title'); $value['address'] = $value['province'] . $value['city'] . $value['district'] . $value['detail']; $value['sex'] = $value['sex'] == 1 ? '男' : '女'; } $count = self::setWhere($where)->count(); return compact('data', 'count'); } }