💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 列表demo ~~~ //>备注格式 : 终端定位路径 - 模块说明 include '../../../conf/v8.php'; $post = $H_A->post(); extract($post); $json = []; $json['succeed'] = 0; empty(判断参) ? $H_A->error($json,'异常操作['.__LINE__.']') : NULL; empty($PIN) ? $H_A->error($json,'异常操作['.__LINE__.']') : NULL; is_numeric($PIN) ? NULL : $PIN = 1; //>统计总数 $other = []; $other['field'] = ['count(*) as total']; $where = []; $where[] = 'enable="1"'; $other['where'] = $where; $row = $Sql->row('表名',$other); extract($row); $json['total'] = $total; $list_every_num = 10; //>每页条数 $PIN = $PIN < 1 ? 1 : $PIN; //>当前页码 $start = ($PIN - 1) * $list_every_num; //>起始位置 $json['option'] = $PIN==1 ? 1 : 2; //>操作(1刷新2加载) //>获取数据列表 $other['field'] = ['获取字段名']; $other['order'] = '排序'; $other['limit'] = $start.','.$list_every_num; $arr = $Sql->arr('表名',$other); $json['next'] = empty($arr) ? $PIN : $PIN + 1; if(empty($arr)){ $json['succeed'] = 2; $PIN == 1 ? $H_A->error($json,'暂无数据') : $H_A->error($json,'已经到底了'); } $obj = []; foreach ($arr as $keyword => $value) { extract($value); //>字段格式处理 $obj[] = $value; } $json['list'] = $obj; $json['succeed'] = 1; $H_A->error($json,'请求成功['.__LINE__.']') ; ~~~