where('is_del', 0); } /** * @param $where * @param $page * @param $limit * @param bool $admin * @return array */ public static function getList($where, $page, $limit, bool $admin = false): array { $model = self::validWhere($admin); if (isset($where['is_show']) && $where['is_show'] != '') $model = $model->where('is_show', $where['is_show']); if (isset($where['title']) && $where['title'] != '') $model = $model->where('name', 'like', "%" . $where['title'] . "%"); if (isset($where['lala_id']) && $where['lala_id'] != '') $model = $model->where("FIND_IN_SET('" . $where['lala_id'] . "',lala_id)"); $data = $model->page((int)$page, (int)$limit)->select()->each(function ($item){ $item['money_type'] = get_money_name($item['money_type']); }); $count = $model->count(); return compact('data', 'count'); } }