本文整理汇总了PHP中CampaignDbTables::getTableName_Anken方法的典型用法代码示例。如果您正苦于以下问题:PHP CampaignDbTables::getTableName_Anken方法的具体用法?PHP CampaignDbTables::getTableName_Anken怎么用?PHP CampaignDbTables::getTableName_Anken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CampaignDbTables
的用法示例。
在下文中一共展示了CampaignDbTables::getTableName_Anken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CampaignDbTables
/**
* 提携メディアリストを取得します。
* @param string キャンペーンコード
* @param array 検索条件
* @param string 単価タイプ
* @return array 提携メディアリスト
*/
public function &Anken_TeikeiIndex_getAnkenTeikeiList($code, $like, $priceTypeCd)
{
$db =& $this->_core->getDB();
$tables = new CampaignDbTables($code);
$teikeiAnkenStatus = $like['teikei_media_status'];
$hatena = str_repeat('?,', count($teikeiAnkenStatus));
$hatena = trim($hatena, ',');
$name_media = $tables->getTableName_Media();
$name_anken = $tables->getTableName_Anken();
$param = array();
$where = "";
if (empty($teikeiAnkenStatus) == false) {
$where .= " and CA.nyuko_status in ({$hatena}) ";
if (in_array(0, $teikeiAnkenStatus) == true) {
$where .= " or CA.nyuko_status is null ";
}
$param = $teikeiAnkenStatus;
}
$sql = <<<SQL
select
CM.teikei_media_id,
C.media_company_id,
C.media_company_name,
M.media_id,
M.media_name,
CM.media_url,
CM.price,
CM.oroshi_price,
CM.teikei_from,
CM.teikei_to,
CM.extra_price,
CM.extra_oroshi,
CA.anken_send_flg,
CA.nyuko_send_flg,
CA.media_test_flg,
CA.keisai_test_flg,
CA.keisai_end_flg,
CA.anken_finish_flg,
CASE WHEN CA.nyuko_status is null THEN '0' ELSE CA.nyuko_status END as nyuko_status
from {$name_media} as CM
left join {$name_anken} as CA
on CM.teikei_media_id = CA.teikei_media_id
left join ald_anken_genko as G
on CM.anken_id = G.anken_id
inner join ald_media as M
on CM.media_id = M.media_id
inner join ald_media_company as C
on C.media_company_id = M.media_company_id
where 1
{$where}
order by CM.teikei_media_id
SQL;
return $db->query($sql, $param);
}