/** * AgreementModel::getList() * 获取列表 * @param string $where * @param string $limit * @return array */ public static function getList($where = null, $limit = null) { try { self::initDB(); $where = is_null($where) ? self::getWhere() : $where; $limit = is_null($limit) ? self::getLimit() : $limit; $sqlStr = "select * from ph_agreement where {$where} "; //file_put_contents(WEB_PATH.'log/sql.txt', var_export($_GET,true)."\r\n\r\n", FILE_APPEND);//test //file_put_contents(WEB_PATH.'log/sql.txt', $sqlStr."\r\n\r\n", FILE_APPEND);//test //echo $sqlStr;exit; $sql = self::$dbConn->execute($sqlStr); $totalNum = self::$dbConn->num_rows($sql); $sql = $sqlStr . "{$limit}"; $sql = self::$dbConn->execute($sql); $listData = self::$dbConn->getResultArray($sql); $data = array("totalNum" => $totalNum, "listData" => $listData); return $data; } catch (Exception $e) { self::$errCode = 10000; self::$errMsg = $e->getMessage(); return false; } }