0

私は SugarCRM を使用しており、プロスペクトをエクスポートすると、追加したカスタム フィールドを含むすべてのフィールドを取得できます。しかし、プロスペクト リストからプロスペクトをダウンロードしようとすると、いくつかのフィールドのみがデータベースからエクスポートされます。プロスペクトのダウンロードなど、すべてのフィールドを取得する必要があります

Prospect_list.php ファイルにこれをエクスポートするためのコードが含まれていることを理解しています。これを変更しましたが、データベース障害が発生したので、これを行うのを手伝ってください。

$prospects_query = "SELECT p.id AS id, 'Prospects' AS related_type, '' AS \"name\", p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation, 
                p.primary_address_street AS primary_address_street,p.primary_address_city AS primary_address_city, p.primary_address_state AS primary_address_state,  p.primary_address_postalcode AS primary_address_postalcode, p.primary_address_country AS primary_address_country,
                p.account_name AS account_name,
                ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
                p.do_not_call AS do_not_call, p.phone_fax AS phone_fax, p.phone_other AS phone_other, p.phone_home AS phone_home, p.phone_mobile AS phone_mobile, p.phone_work AS phone_work , p.description As Description
                FROM prospect_lists_prospects plp
                INNER JOIN prospects p ON plp.related_id=p.id
                LEFT JOIN email_addr_bean_rel ear ON  ear.bean_id=p.id AND ear.deleted=0
                LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id
                WHERE plp.prospect_list_id = $record_id  AND plp.deleted=0 
                AND p.deleted=0
                AND (ear.deleted=0 OR ear.deleted IS NULL)";

ここで砂糖チームはエクスポートするフィールドを指定しましたが、テーブル [見込み客] のすべてのフィールドを取得する必要があります。

4

1 に答える 1

0

クエリをこれに変更しようとしています...

$prospects_query = "SELECT p.id AS id, 'Prospects' AS related_type, '' AS 'name', p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation, 
            p.primary_address_street AS primary_address_street,p.primary_address_city AS primary_address_city, p.primary_address_state AS primary_address_state,  p.primary_address_postalcode AS primary_address_postalcode, p.primary_address_country AS primary_address_country,
            p.account_name AS account_name,
            ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
            p.do_not_call AS do_not_call, p.phone_fax AS phone_fax, p.phone_other AS phone_other, p.phone_home AS phone_home, p.phone_mobile AS phone_mobile, p.phone_work AS phone_work , p.description As Description
            FROM prospect_lists_prospects plp
            INNER JOIN prospects p ON plp.related_id=p.id
            LEFT JOIN email_addr_bean_rel ear ON  ear.bean_id=p.id AND ear.deleted=0
            LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id
            WHERE plp.prospect_list_id = '$record_id'  AND plp.deleted=0 
            AND p.deleted=0
            AND (ear.deleted=0 OR ear.deleted IS NULL)";
于 2013-01-10T19:55:00.070 に答える