漏刻有时多功能php-API接口开发实例
2021/6/12 12:24:46
本文主要是介绍漏刻有时多功能php-API接口开发实例,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
/*06.疑难点位管理*/ function getDifficult() { global $db, $res; dbc(); @$poi_address = get_param("poi_address"); @$poi_sn = get_param("poi_sn"); @$poi_ins5 = $_GET["poi_ins5"]; @$p = $_GET['page'] == "" ? 1 : $_GET['page'];//获取用户选择的页码 @$pagesize = $_GET['limit'] == "" ? 15 : $_GET['limit'];//获取用户选择的每页显示多少条数据 @$limit = ($p - 1) * $pagesize;//偏移量 $sql = "select a.main_id,a.poi_id,a.poi_sn,a.poi_name,a.poi_address,a.poi_difficult,a.poi_md,from_unixtime(a.poi_brdown) as poi_brdown,b.poi_id,b.poi_ins1,b.poi_ins2,b.poi_ins3,b.poi_ins4,b.poi_bdlng AS poi_lon,b.poi_bdlat AS poi_lat from " . $db->table('maintain') . " AS a," . $db->table('poi') . " AS b WHERE a.poi_id = b.poi_id"; $sql .= " AND a.poi_difficult = 1"; //编号和名称搜索; IF ($poi_sn != "") { $sql .= " AND (a.poi_name like '%" . $poi_sn . "%' OR a.poi_sn like '%" . $poi_sn . "%')"; } IF ($poi_ins5 != "") { $sql .= " AND a.poi_ins5 ='" . $poi_ins5 . "'"; } $sql .= " ORDER BY a.main_id DESC LIMIT " . $limit . "," . $pagesize; $row = $db->queryall($sql); $sql_c = "select a.main_id,a.poi_id,a.poi_sn,a.poi_name,a.poi_address,a.poi_difficult,from_unixtime(a.poi_brdown) as poi_brdown,b.poi_id,b.poi_ins1,b.poi_ins2,b.poi_ins3,b.poi_ins4 from " . $db->table('maintain') . " AS a," . $db->table('poi') . " AS b WHERE a.poi_id = b.poi_id"; $sql_c .= " AND a.poi_difficult = 1"; //编号和名称搜索; IF ($poi_sn != "") { $sql_c .= " AND (a.poi_name like '%" . $poi_sn . "%' OR a.poi_sn like '%" . $poi_sn . "%')"; } IF ($poi_ins5 != "") { $sql_c .= " AND a.poi_ins5 ='" . $poi_ins5 . "'"; } $sql_c .= " ORDER BY a.main_id DESC LIMIT " . $limit . "," . $pagesize; $row_c = $db->queryall($sql_c); $res['code'] = 0; $res['count'] = count($row_c); $res["data"] = $row; die(json_encode_lockdata($res)); }
Lockdatav Done!
这篇关于漏刻有时多功能php-API接口开发实例的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23怎么实现安卓+php 热更新方案?-icode9专业技术文章分享
- 2024-11-22PHP 中怎么实现判断多个值是否为空、null 或者为 false?-icode9专业技术文章分享
- 2024-11-11开源 PHP 商城项目 CRMEB 二次开发和部署教程
- 2024-11-09怎么使用php在kaufland平台刊登商品?-icode9专业技术文章分享
- 2024-11-05PHP的抽象类和接口是什么,有什么区别-icode9专业技术文章分享
- 2024-11-01开源 PHP 商城项目 CRMEB 安装和使用教程
- 2024-11-01用php和mysql写无限分类,有哪几种方法-icode9专业技术文章分享
- 2024-10-31php数据分表导出时部分数据无法导出什么原因-icode9专业技术文章分享
- 2024-10-30有经验的 PHP 开发者学习一门新的编程语言,有哪些推荐的有前景的语言-icode9专业技术文章分享
- 2024-10-21php 检测图片是否篡改过-icode9专业技术文章分享