漏刻有时多功能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!

上一篇:C语言 --- switch语句的原理(goto版本)


下一篇:python中iloc与loc的区别