本文整理匯總了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("Заказ не найден или его уже отмодерировали");
}
}