本文整理汇总了PHP中Campaign::search_by_domain方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::search_by_domain方法的具体用法?PHP Campaign::search_by_domain怎么用?PHP Campaign::search_by_domain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::search_by_domain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTableName
protected function getTableName()
{
$campaign = Campaign::search_by_domain($_SERVER['SERVER_NAME']);
if ($campaign->id) {
return '`' . $campaign->id . '_ProjectMessages`';
} else {
return "`ProjectMessages`";
}
}
示例2: actionModerationAnswer
/**
* Одобрение или нет заказа
* @param $answer
* @author Emericanec
*/
public function actionModerationAnswer($id, $event_id, $answer)
{
$model = Zakaz::model()->resetScope()->findByPk($id);
$event = Events::model()->findByPk($event_id);
if (!$model->is_active && $event) {
if ($answer == 1) {
$model->is_active = 1;
if ($model->save()) {
$event->delete();
// Заказчику проект принят
$type_id = Emails::TYPE_12;
$email = new Emails();
$order = Zakaz::model()->findByPk($id);
$user = User::model()->findByPk($order->user_id);
$email->from_id = 1;
$email->to_id = $user->id;
$rec = Templates::model()->findAll("`type_id`='{$type_id}'");
$campaign = Campaign::search_by_domain($_SERVER['SERVER_NAME']);
$email->campaign = $campaign->name;
$email->name = $user->full_name;
$email->num_order = $id;
$email->page_order = 'http://' . $_SERVER['SERVER_NAME'] . '/project/chat?orderId=' . $id;
//$email->login= $user->username;
//$email->password= $soucePassword;
$email->sendTo($user->email, $rec[0]->title, $rec[0]->text, $type_id);
$this->redirect(Yii::app()->createUrl('project/zakaz/update', array('id' => $model->id)));
}
} else {
// если нет то просто удаляем
$model->delete();
$event->delete();
$this->redirect(Yii::app()->createUrl('project/event'));
}
} else {
$event->delete();
throw new CHttpException("Заказ не найден или его уже отмодерировали");
}
}