MODEL_APP::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 (app_name LIKE '%" . $arr_search["key"] . "%' OR app_note LIKE '%" . $arr_search["key"] . "%')";
        }
        if (isset($arr_search["status"]) && $arr_search["status"]) {
            $_str_sqlWhere .= " AND app_status='" . $arr_search["status"] . "'";
        }
        if (isset($arr_search["sync"]) && $arr_search["sync"]) {
            $_str_sqlWhere .= " AND app_sync='" . $arr_search["sync"] . "'";
        }
        if (isset($arr_search["has_notify"])) {
            $_str_sqlWhere .= " AND LENGTH(app_url_notify)>0";
        }
        if (isset($arr_search["has_sync"])) {
            $_str_sqlWhere .= " AND LENGTH(app_url_sync)>0";
        }
        if (isset($arr_search["not_ids"]) && $arr_search["not_ids"]) {
            $_str_appIds = implode(",", $arr_search["not_ids"]);
            $_str_sqlWhere .= " AND app_id NOT IN (" . $_str_appIds . ")";
        }
        return $_str_sqlWhere;
    }