當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Campaign::search_by_domain方法代碼示例

本文整理匯總了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`";
     }
 }
開發者ID:rahmanjis,項目名稱:dipstart-development,代碼行數:9,代碼來源:YiiChatDbHandlerBase.php

示例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("Заказ не найден или его уже отмодерировали");
     }
 }
開發者ID:akoch-ov,項目名稱:dipstart-development,代碼行數:43,代碼來源:ZakazController.php


注:本文中的Campaign::search_by_domain方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。