select()->toArray(); } //根据ID获取单条数据 public static function getById($id) { if($id <= 0){ return []; } return self::where('id', $id)->findOrEmpty()->toArray(); } //根据ID更新数据 public static function updateById($id, $data) { return self::where('id', $id)->update($data); } //根据where条件和排序获取记录 public static function getListByWhereAndOrder($where, $order, $limit = 1) { return self::where($where) ->order($order) ->limit($limit) ->select() ->toArray(); } // 根据ID查询记录详情 public static function findInfoById($id) { return self::where('id', $id)->find(); } }