MODEL_LOG::sql_process PHP Method

sql_process() private method

列出及统计 SQL 处理 sql_process function.
private sql_process ( array $arr_search = [] ) : void
$arr_search array (default: array())
return void
    private function sql_process($arr_search = array())
    {
        $_str_sqlWhere = "1=1";
        if (isset($arr_search["key"]) && $arr_search["key"]) {
            $_str_sqlWhere .= " AND (log_target_type LIKE '%" . $arr_search["key"] . "%' OR log_result LIKE '%" . $arr_search["key"] . "%')";
        }
        if (isset($arr_search["type"]) && $arr_search["type"]) {
            $_str_sqlWhere .= " AND log_type='" . $arr_search["type"] . "'";
        }
        if (isset($arr_search["status"]) && $arr_search["status"]) {
            $_str_sqlWhere .= " AND log_status='" . $arr_search["status"] . "'";
        }
        if (isset($arr_search["level"]) && $arr_search["level"]) {
            $_str_sqlWhere .= " AND log_level='" . $arr_search["level"] . "'";
        }
        if (isset($arr_search["operator_id"]) && $arr_search["operator_id"] > 0) {
            $_str_sqlWhere .= " AND log_operator_id=" . $arr_search["operator_id"];
        }
        return $_str_sqlWhere;
    }